Skip to content

Commit cd3d05d

Browse files
committed
Fix the wrong serializer better.
1 parent a0df57e commit cd3d05d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/rocket_pants/controller/respondable.rb

+4-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ def self.extract_pagination(collection)
6262
end
6363

6464
def self.normalise_object(object, options = {})
65+
# So we don't use the wrong options / modify them up the chain...
66+
options = options.dup
67+
6568
# First, prepare the object for serialization.
6669
object = normalise_to_serializer object, options
6770

@@ -71,7 +74,7 @@ def self.normalise_object(object, options = {})
7174
if each_serializer = suboptions.delete(:each_serializer)
7275
suboptions[:serializer] = each_serializer
7376
end
74-
object.map { |o| normalise_object o, suboptions.dup }
77+
object.map { |o| normalise_object o, suboptions }
7578
elsif object.respond_to?(:serializable_hash)
7679
object.serializable_hash options
7780
elsif object.respond_to?(:as_json)

0 commit comments

Comments
 (0)