From 418721302bf494b01618fbde6f198201a8a4b3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Moura?= Date: Fri, 10 Jul 2015 12:02:17 -0300 Subject: [PATCH] defining json_key(root) as model class name --- lib/active_model/serializer.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/active_model/serializer.rb b/lib/active_model/serializer.rb index 9f62e6157..418f10bae 100644 --- a/lib/active_model/serializer.rb +++ b/lib/active_model/serializer.rb @@ -169,7 +169,7 @@ def initialize(object, options = {}) end def json_key - @root || self.class.root_name + @root || object.class.model_name.to_s.downcase end def id