Sha256: 4dde350f6b318a7e2c5cb3c19c72c6b1addd67eb2155826ca621490db9be0e15
Contents?: true
Size: 1013 Bytes
Versions: 9
Compression:
Stored size: 1013 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Persistence #:nodoc: # Remove is a persistence command responsible for deleting a document from # the database. # # The underlying query resembles the following MongoDB query: # # collection.remove( # { "_id" : 1 }, # false # ); class Remove < Command # Remove the document from the database: delegates to the MongoDB # collection remove method. # # Example: # # <tt>Remove.persist</tt> # # Returns: # # +true+ if success, +false+ if not. def persist remove end protected # Remove the document from the database. def remove if document.embedded? Persistence::RemoveEmbedded.new( document, options.merge(:validate => validate) ).persist else collection.remove({ :_id => document.id }, options) end; true end end end end
Version data entries
9 entries across 9 versions & 2 rubygems