Skip to content

Commit 4187213

Browse files
joaomdmouraJoão M. D. Moura
authored andcommitted
defining json_key(root) as model class name
1 parent 6266b6a commit 4187213

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/active_model/serializer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def initialize(object, options = {})
169169
end
170170

171171
def json_key
172-
@root || self.class.root_name
172+
@root || object.class.model_name.to_s.downcase
173173
end
174174

175175
def id

0 commit comments

Comments
 (0)