Skip to content

Commit 4976837

Browse files
committed
Fix options passing in Json and Attributes adapters.
1 parent 88785ea commit 4976837

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/active_model/serializer/adapter/attributes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def initialize(serializer, options = {})
1010
def serializable_hash(options = nil)
1111
options ||= {}
1212
if serializer.respond_to?(:each)
13-
result = serializer.map { |s| Attributes.new(s).serializable_hash(options) }
13+
result = serializer.map { |s| Attributes.new(s, instance_options).serializable_hash(options) }
1414
else
1515
hash = {}
1616

lib/active_model/serializer/adapter/json.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class Json < Base
77

88
def serializable_hash(options = nil)
99
options ||= {}
10-
{ root => Attributes.new(serializer).serializable_hash(options) }
10+
{ root => Attributes.new(serializer, instance_options).serializable_hash(options) }
1111
end
1212

1313
private

0 commit comments

Comments
 (0)