File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
lib/active_model/serializer Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -82,7 +82,7 @@ def meta_key
82
82
end
83
83
84
84
def root
85
- @options . fetch ( :root ) { serializer . json_key }
85
+ serializer . json_key
86
86
end
87
87
88
88
def include_meta ( json )
Original file line number Diff line number Diff line change
1
+ require 'active_model/serializer/adapter/json/fragment_cache'
2
+
3
+ module ActiveModel
4
+ class Serializer
5
+ class Adapter
6
+ class FlattenJson < Json
7
+ def serializable_hash ( options = { } )
8
+ super
9
+ @result
10
+ end
11
+ end
12
+
13
+ def fragment_cache ( cached_hash , non_cached_hash )
14
+ Json ::FragmentCache . new ( ) . fragment_cache ( cached_hash , non_cached_hash )
15
+ end
16
+ end
17
+ end
18
+ end
Original file line number Diff line number Diff line change @@ -37,11 +37,7 @@ def serializable_hash(options = {})
37
37
@result = @core . merge @hash
38
38
end
39
39
40
- if root
41
- @result = { root => @result }
42
- else
43
- @result
44
- end
40
+ { root => @result }
45
41
end
46
42
end
47
43
You can’t perform that action at this time.
0 commit comments