mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-24 14:56:50 +00:00
Re-order properties
This commit is contained in:
parent
93baaa96b1
commit
9e75625b1f
@ -29,13 +29,13 @@ module ActiveModel
|
|||||||
|
|
||||||
def initialize(object, options={})
|
def initialize(object, options={})
|
||||||
@object = object
|
@object = object
|
||||||
|
@scope = options[:scope]
|
||||||
@root = options[:root] || self.class._root
|
@root = options[:root] || self.class._root
|
||||||
@root = self.class.root_name if @root == true
|
@root = self.class.root_name if @root == true
|
||||||
@scope = options[:scope]
|
|
||||||
@meta_key = options[:meta_key] || :meta
|
@meta_key = options[:meta_key] || :meta
|
||||||
@meta = options[@meta_key]
|
@meta = options[@meta_key]
|
||||||
end
|
end
|
||||||
attr_accessor :object, :root, :scope, :meta_key, :meta
|
attr_accessor :object, :scope, :root, :meta_key, :meta
|
||||||
|
|
||||||
alias read_attribute_for_serialization send
|
alias read_attribute_for_serialization send
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user