Methods

Class/Module Index [+]

Quicksearch

Mongoid::Persistence::Deletion

Contains common logic for delete operations.

Public Instance Methods

prepare(&block) click to toggle source

Wrap all the common delete logic for both root and embedded documents and then yield to the block.

@example Execute common delete logic.

prepare do |doc|
  collection.remove({ :_id => "value })
end

@param [ Proc ] block The block to call.

@return [ true ] Always true.

@since 2.1.0

# File lib/mongoid/persistence/deletion.rb, line 20
def prepare(&block)
  document.cascade!
  yield(document)
  document.freeze
  document.destroyed = true
  IdentityMap.remove(document)
  document.clear_timeless_option
  true
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.