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
classiccms-0.3.1 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.3.1 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.3.0 vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.3.0 vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
classiccms-0.3.0 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classiccms-0.2.4.pre vendor/bundle/gems/mongoid-2.4.10/lib/mongoid/persistence/operations/remove.rb
classiccms-0.2.4.pre vendor/bundle/gems/mongoid-2.4.9/lib/mongoid/persistence/operations/remove.rb
classiccms-0.2.4.pre vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
mongoid-2.4.10 lib/mongoid/persistence/operations/remove.rb
mongoid-2.4.9 lib/mongoid/persistence/operations/remove.rb
mongoid-2.4.8 lib/mongoid/persistence/operations/remove.rb
classicCMS-0.2.3 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classicCMS-0.2.2 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classicCMS-0.2.1 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classicCMS-0.2.0 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
classicCMS-0.1.2 vendor/bundle/gems/mongoid-2.4.7/lib/mongoid/persistence/operations/remove.rb
mongoid-2.4.7 lib/mongoid/persistence/operations/remove.rb
mongoid-multi-db-3.0.0 lib/mongoid/persistence/operations/remove.rb
mongoid-2.4.6 lib/mongoid/persistence/operations/remove.rb
mongoid-2.2.6 lib/mongoid/persistence/operations/remove.rb