We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7a1585 commit 98d009aCopy full SHA for 98d009a
lib/active_model/serializer/adapter.rb
@@ -22,7 +22,7 @@ def serializable_hash(options = nil)
22
23
def as_json(options = nil)
24
hash = serializable_hash(options)
25
- include_meta(hash) unless self.class == FlattenJson
+ include_meta(hash)
26
hash
27
end
28
lib/active_model/serializer/adapter/flatten_json.rb
@@ -6,6 +6,13 @@ def serializable_hash(options = {})
6
super
7
@result
8
9
+
10
+ private
11
12
+ # no-op: FlattenJson adapter does not include meta data, because it does not support root.
13
+ def include_meta(json)
14
+ json
15
+ end
16
17
18
0 commit comments