Fix support for custom root in JSON-API adapter

This commit is contained in:
Guillermo Iguaran
2014-10-22 03:55:17 -03:00
parent 47deb87e81
commit 5f198667be
2 changed files with 18 additions and 1 deletions

View File

@@ -8,7 +8,7 @@ module ActiveModel
end
def serializable_hash(options = {})
@root = (options[:root] || serializer.json_key).to_s.pluralize.to_sym
@root = (options[:root] || serializer.json_key.to_s.pluralize).to_sym
@hash = {}
if serializer.respond_to?(:each)