Define root and root= as aliases of _root=

This commit is contained in:
Santiago Pastorino 2013-08-23 21:38:02 -03:00
parent 7ba05c02e3
commit 3fcd8c5f98
2 changed files with 4 additions and 10 deletions

View File

@ -7,11 +7,8 @@ module ActiveModel
class << self
attr_accessor :_root
def root(root)
@_root = root
end
alias root= root
alias root _root=
alias root= _root=
end
def initialize(object, options={})

View File

@ -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