Method: MongoDoc::Document#update
- Defined in:
- lib/mongo_doc/document.rb
#update(attrs, safe = false) ⇒ Object
Update without checking validations. The Document
will be saved without validations if it is a new record.
128 129 130 131 132 133 134 135 136 |
# File 'lib/mongo_doc/document.rb', line 128 def update(attrs, safe = false) self.attributes = attrs if new_record? _root.send(:_save, safe) if _root _save(safe) else _update_attributes(converted_attributes(attrs), safe) end end |