Sha256: 747aebddbe9bc90bfafa5548dda716c9722f2e3f3062dc249a70f3faa4fbbfcf
Contents?: true
Size: 498 Bytes
Versions: 13
Compression:
Stored size: 498 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Commands class Destroy # 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 doc.collection.remove(:_id => doc.id) doc.run_callbacks :after_destroy end end end end
Version data entries
13 entries across 13 versions & 1 rubygems