mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Make include_meta and meta_key private
This commit is contained in:
parent
76fead041f
commit
aaa08c25ef
@ -1,13 +1,5 @@
|
|||||||
module ActiveModel
|
module ActiveModel
|
||||||
module Serializable
|
module Serializable
|
||||||
def meta_key
|
|
||||||
options[:meta_key].try(:to_sym) || :meta
|
|
||||||
end
|
|
||||||
|
|
||||||
def include_meta(hash)
|
|
||||||
hash[meta_key] = options[:meta] if options.has_key?(:meta)
|
|
||||||
end
|
|
||||||
|
|
||||||
def as_json(args={})
|
def as_json(args={})
|
||||||
if root = args[:root] || options[:root]
|
if root = args[:root] || options[:root]
|
||||||
options[:hash] = hash = {}
|
options[:hash] = hash = {}
|
||||||
@ -30,5 +22,15 @@ module ActiveModel
|
|||||||
super
|
super
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def include_meta(hash)
|
||||||
|
hash[meta_key] = options[:meta] if options.has_key?(:meta)
|
||||||
|
end
|
||||||
|
|
||||||
|
def meta_key
|
||||||
|
options[:meta_key].try(:to_sym) || :meta
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user