Module: Mongoid::Persistable::Creatable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Mongoid::Persistable
- Defined in:
- lib/mongoid/persistable/creatable.rb
Overview
Defines behaviour 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.
22 23 24 25 26 27 28 29 30 |
# File 'lib/mongoid/persistable/creatable.rb', line 22 def insert( = {}) prepare_insert() do if else insert_as_root end end end |