Do not convert root and meta_key to Strings

This commit is contained in:
Santiago Pastorino
2013-09-15 23:43:41 -03:00
parent 75e9a2599d
commit daa9304398
5 changed files with 30 additions and 30 deletions

View File

@@ -2,7 +2,7 @@ module ActiveModel
module Serializable
def as_json(options={})
if root = options[:root] || self.root
hash = { root.to_s => serializable_object }
hash = { root => serializable_object }
hash.merge!(serializable_data)
hash
else
@@ -12,7 +12,7 @@ module ActiveModel
def serializable_data
if respond_to?(:meta) && meta
{ meta_key.to_s => meta }
{ meta_key => meta }
else
{}
end