mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 07:16:49 +00:00
Define root and root= as aliases of _root=
This commit is contained in:
@@ -21,11 +21,8 @@ module ActiveModel
|
||||
end
|
||||
|
||||
attr_accessor :_root, :_attributes, :_associations
|
||||
|
||||
def root(root)
|
||||
@_root = root
|
||||
end
|
||||
alias root= root
|
||||
alias root _root=
|
||||
alias root= _root=
|
||||
|
||||
def root_name
|
||||
name.demodulize.underscore.sub(/_serializer$/, '') if name
|
||||
|
||||
Reference in New Issue
Block a user