Module: MongoMapper::Plugins::Querying::InstanceMethods
- Defined in:
- lib/mongo_mapper/plugins/querying.rb
Instance Method Summary collapse
Instance Method Details
#delete ⇒ Object
209 210 211 212 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 209 def delete @_destroyed = true self.class.delete(id) unless new? end |
#destroy ⇒ Object
205 206 207 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 205 def destroy delete end |
#save(options = {}) ⇒ Object
194 195 196 197 198 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 194 def save(={}) .assert_valid_keys(:validate, :safe) .reverse_merge!(:validate => true) ![:validate] || valid? ? create_or_update() : false end |
#save!(options = {}) ⇒ Object
200 201 202 203 |
# File 'lib/mongo_mapper/plugins/querying.rb', line 200 def save!(={}) .assert_valid_keys(:safe) save() || raise(DocumentNotValid.new(self)) end |