Sha256: 8fb83b4fe986c76517e19588a71dca8f178e7d6401fc0c0e4220ea77f6aa1b33

Contents?: true

Size: 494 Bytes

Versions: 38

Compression:

Stored size: 494 Bytes

Contents

# encoding: utf-8
module Mongoid #:nodoc:
  module Commands
    class Destroy
      extend Deletion
      # Performs a destroy of the supplied +Document+, with the necessary
      # callbacks. It then deletes the record from the collection.
      #
      # Options:
      #
      # doc: A new +Document+ that is going to be destroyed.
      def self.execute(doc)
        doc.run_callbacks :before_destroy
        delete(doc)
        doc.run_callbacks :after_destroy
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
mongoid-1.2.12 lib/mongoid/commands/destroy.rb
mongoid-1.2.11 lib/mongoid/commands/destroy.rb
mongoid-1.2.10 lib/mongoid/commands/destroy.rb
mongoid-1.2.9 lib/mongoid/commands/destroy.rb
mongoid-1.2.8 lib/mongoid/commands/destroy.rb
mongoid-1.2.7 lib/mongoid/commands/destroy.rb
mongoid-1.2.6 lib/mongoid/commands/destroy.rb
mongoid-1.2.5 lib/mongoid/commands/destroy.rb
mongoid-1.2.4 lib/mongoid/commands/destroy.rb
mongoid-1.2.3 lib/mongoid/commands/destroy.rb
mongoid-1.2.2 lib/mongoid/commands/destroy.rb
mongoid-1.2.1 lib/mongoid/commands/destroy.rb
mongoid-1.2.0 lib/mongoid/commands/destroy.rb
mongoid-1.1.4 lib/mongoid/commands/destroy.rb
mongoid-1.1.3 lib/mongoid/commands/destroy.rb
mongoid-1.1.2 lib/mongoid/commands/destroy.rb
mongoid-1.1.1 lib/mongoid/commands/destroy.rb
mongoid-1.1.0 lib/mongoid/commands/destroy.rb
mongoid-1.0.6 lib/mongoid/commands/destroy.rb
mongoid-1.0.5 lib/mongoid/commands/destroy.rb