Module: MongoMapper::Plugins::Querying::InstanceMethods
- Defined in:
- lib/mongo_mapper/plugins/querying.rb
Instance Method Summary collapse
Instance Method Details
#delete ⇒ Object
150 151 152 153 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 150 def delete @_destroyed = true self.class.delete(id) unless new? end |
#destroy ⇒ Object
146 147 148 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 146 def destroy delete end |
#save(options = {}) ⇒ Object
135 136 137 138 139 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 135 def save(={}) .assert_valid_keys(:validate, :safe) .reverse_merge!(:validate => true) ![:validate] || valid? ? create_or_update() : false end |
#save!(options = {}) ⇒ Object
141 142 143 144 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 141 def save!(={}) .assert_valid_keys(:safe) save() || raise(DocumentNotValid.new(self)) end |