File tree Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Expand file tree Collapse file tree 2 files changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -145,14 +145,6 @@ def self.adapter
145
145
adapter_class
146
146
end
147
147
148
- def self . _root
149
- @@root ||= false
150
- end
151
-
152
- def self . _root = ( root )
153
- @@root = root
154
- end
155
-
156
148
def self . root_name
157
149
name . demodulize . underscore . sub ( /_serializer$/ , '' ) if name
158
150
end
@@ -162,7 +154,7 @@ def self.root_name
162
154
def initialize ( object , options = { } )
163
155
@object = object
164
156
@options = options
165
- @root = options [ :root ] || ( self . class . _root ? self . class . root_name : false )
157
+ @root = options [ :root ]
166
158
@meta = options [ :meta ]
167
159
@meta_key = options [ :meta_key ]
168
160
@scope = options [ :scope ]
@@ -176,7 +168,7 @@ def initialize(object, options = {})
176
168
end
177
169
178
170
def json_key
179
- if root == true || root . nil?
171
+ if root . nil?
180
172
self . class . root_name
181
173
else
182
174
root
Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ def serializable_hash(options = {})
8
8
super
9
9
@result
10
10
end
11
- end
12
11
13
- def fragment_cache ( cached_hash , non_cached_hash )
14
- Json ::FragmentCache . new ( ) . fragment_cache ( cached_hash , non_cached_hash )
12
+ def root
13
+ false
14
+ end
15
15
end
16
16
end
17
17
end
You can’t perform that action at this time.
0 commit comments