Allow using root = false in initialize

This commit is contained in:
Santiago Pastorino
2013-09-14 21:15:04 -03:00
parent 8462a73f3a
commit 626a85bc3e
4 changed files with 23 additions and 2 deletions

View File

@@ -15,7 +15,8 @@ module ActiveModel
def initialize(object, options={})
@object = object
@options = options
@root = options[:root] || self.class._root
@root = options[:root]
@root = self.class._root if @root.nil?
@meta_key = options[:meta_key] || :meta
@meta = options[@meta_key]
end