mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Fix options passing in Json and Attributes adapters.
This commit is contained in:
@@ -10,7 +10,7 @@ module ActiveModel
|
|||||||
def serializable_hash(options = nil)
|
def serializable_hash(options = nil)
|
||||||
options ||= {}
|
options ||= {}
|
||||||
if serializer.respond_to?(:each)
|
if serializer.respond_to?(:each)
|
||||||
result = serializer.map { |s| Attributes.new(s).serializable_hash(options) }
|
result = serializer.map { |s| Attributes.new(s, instance_options).serializable_hash(options) }
|
||||||
else
|
else
|
||||||
hash = {}
|
hash = {}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ module ActiveModel
|
|||||||
|
|
||||||
def serializable_hash(options = nil)
|
def serializable_hash(options = nil)
|
||||||
options ||= {}
|
options ||= {}
|
||||||
{ root => Attributes.new(serializer).serializable_hash(options) }
|
{ root => Attributes.new(serializer, instance_options).serializable_hash(options) }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Reference in New Issue
Block a user