Module: Mongoid::Persistable::Creatable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Persistable
- Defined in:
- lib/mongoid/persistable/creatable.rb
Overview
Defines behavior for persistence operations that create new documents.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
-
#insert(options = {}) ⇒ Document
Insert a new document into the database.
Instance Method Details
#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 |