lib/mongoid/interceptable.rb
# Run the callbacks for the document. This overrides active support's
# functionality to cascade callbacks to embedded documents that have been
# flagged as such.
#
# @example Run the callbacks.
#   run_callbacks :save do
#     save!
#   end
#
# @param [ Symbol ] kind The type of callback to execute.
# @param [ true | false ] with_children Flag specifies whether callbacks of embedded document should be run.
Run the callbacks for the document. This overrides active support's
functionality to cascade callbacks to embedded documents that have been
flagged as such.
Run the callbacks for the document . This overrides active support ' s functionality to cascade callbacks to embedded documents that have been flagged as such .
def run_callbacks(kind, with_children: true, &block)
      if with_children
        cascadable_children(kind).each do |child|
          if child.run_callbacks(child_callback_type(kind, child), with_children: with_children) == false
            return false
          end
        end
      end
      if callback_executable?(kind)
        super(kind, &block)
      else
        true
      end
    end
def run_callbacks ( kind , with_children : true , & block ) if with_children cascadable_children ( kind ) . each do | child | if child . run_callbacks ( child_callback_type ( kind , child ) , with_children : with_children ) == false return false end end end if callback_executable? ( kind ) super ( kind , & block ) else true end end
Run the callbacks for the document.
Run the callbacks for the document .
kind
<not_specific>
with_children
<not_specific>
block
<not_specific>
<not_specific>
with_children Flag specifies whether callbacks of embedded document should be run.
with_children Flag specifies whether callbacks of embedded document should be run .
example
Run the callbacks. run_callbacks :save do save. end
Run the callbacks . run_callbacks : save do save . end