Method: Mongoid::Persistable::Creatable#insert
- Defined in:
- lib/mongoid/persistable/creatable.rb
#insert(options = {}) ⇒ Document
Insert a new document into the database. Will return the document itself whether or not the save was successful.
20 21 22 23 24 25 26 27 28 |
# File 'lib/mongoid/persistable/creatable.rb', line 20 def insert( = {}) prepare_insert() do if else insert_as_root end end end |