Method: MongoDoc::Document#update_attributes!

Defined in:
lib/mongodoc/document.rb

#update_attributes!(attrs) ⇒ Object



104
105
106
107
108
109
110
111
112
113
114
# File 'lib/mongodoc/document.rb', line 104

def update_attributes!(attrs)
  strict = attrs.delete(:__strict__)
  self.attributes = attrs
  return save! if new_record?
  raise DocumentInvalidError unless valid?
  if strict
    _strict_update_attributes(_path_to_root(self, attrs), true)
  else
    _naive_update_attributes(_path_to_root(self, attrs), true)
  end
end