Sha256: da8f831b53a80b59ebb8ed02b3cb06a7df6b157d40d46f5727ea1af835eaaa0a

Contents?: true

Size: 832 Bytes

Versions: 188

Compression:

Stored size: 832 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Persistence #:nodoc:
    module Operations #: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
        include Deletion, Operations

        # Remove the document from the database: delegates to the MongoDB
        # collection remove method.
        #
        # @example Remove the document.
        #   Remove.persist
        #
        # @return [ true ] Always true.
        def persist
          prepare do |doc|
            collection.remove({ :_id => doc.id }, options)
          end
        end
      end
    end
  end
end

Version data entries

188 entries across 96 versions & 4 rubygems

Version Path
mongoid-2.7.1 lib/mongoid/persistence/operations/remove.rb
mongoid-2.7.0 lib/mongoid/persistence/operations/remove.rb
mongoid-2.6.0 lib/mongoid/persistence/operations/remove.rb
mongoid-2.5.2 lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.9 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.8 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.7 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
mongoid-2.5.1 lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.6 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.6.5 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb