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