Module | Mongoid::Paranoia |
In: |
lib/mongoid/paranoia.rb
|
Include this module to get soft deletion of root level documents. This will add a deleted_at field to the Document, managed automatically. Potentially incompatible with unique indices. (if collisions with deleted items)
@example Make a document paranoid.
class Person include Mongoid::Document include Mongoid::Paranoia end
Delete the paranoid Document from the database completely. This will run the destroy callbacks.
@example Hard destroy the document.
document.destroy!
@return [ true, false ] If the operation succeeded.
@since 1.0.0
Determines if this document is destroyed.
@example Is the document destroyed?
person.destroyed?
@return [ true, false ] If the document is destroyed.
@since 1.0.0