mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Do not convert root and meta_key to Strings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user