Sha256: 115a4d1dfbdcb117941ddf9322a449a1ad8874e036e258f70050c6ad4005a76f
Contents?: true
Size: 781 Bytes
Versions: 171
Compression:
Stored size: 781 Bytes
Contents
# encoding: utf-8 module Mongoid #:nodoc: module Persistence #:nodoc: # Contains common logic for delete operations. module Deletion # 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 def prepare(&block) document.cascade! yield(document) document.freeze document.destroyed = true IdentityMap.remove(document) Threaded.clear_options! true end end end end
Version data entries
171 entries across 79 versions & 4 rubygems