mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 23:06:50 +00:00
Let FlattenJson adapter decide it doesn't include meta
This commit is contained in:
parent
f7a1585b75
commit
98d009a000
@ -22,7 +22,7 @@ module ActiveModel
|
|||||||
|
|
||||||
def as_json(options = nil)
|
def as_json(options = nil)
|
||||||
hash = serializable_hash(options)
|
hash = serializable_hash(options)
|
||||||
include_meta(hash) unless self.class == FlattenJson
|
include_meta(hash)
|
||||||
hash
|
hash
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,13 @@ module ActiveModel
|
|||||||
super
|
super
|
||||||
@result
|
@result
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
# no-op: FlattenJson adapter does not include meta data, because it does not support root.
|
||||||
|
def include_meta(json)
|
||||||
|
json
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user