mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
defining json_key(root) as model class name
This commit is contained in:
committed by
João M. D. Moura
parent
6266b6a002
commit
418721302b
@@ -169,7 +169,7 @@ module ActiveModel
|
||||
end
|
||||
|
||||
def json_key
|
||||
@root || self.class.root_name
|
||||
@root || object.class.model_name.to_s.downcase
|
||||
end
|
||||
|
||||
def id
|
||||
|
||||
Reference in New Issue
Block a user