lib/mongoid/interceptable.rb
# Run the callbacks for embedded documents.
#
# @param [ Symbol ] kind The type of callback to execute.
# @param [ Array<Document> ] children Children to exeute callbacks on. If
#   nil, callbacks will be executed on all cascadable children of
#   the document.
#
# @api private
Run the callbacks for embedded documents.
Run the callbacks for embedded documents .
def _mongoid_run_child_callbacks(kind, children: nil, &block)
      child, *tail = (children || cascadable_children(kind))
      if child.nil?
        return block&.call
      elsif tail.empty?
        return child.run_callbacks(child_callback_type(kind, child), &block)
      else
        return child.run_callbacks(child_callback_type(kind, child)) do
          _mongoid_run_child_callbacks(kind, children: tail, &block)
        end
      end
    end
def _mongoid_run_child_callbacks ( kind , children : nil , & block ) child , * tail = ( children || cascadable_children ( kind ) ) if child . nil? return block &. call elsif tail . empty? return child . run_callbacks ( child_callback_type ( kind , child ) , & block ) else return child . run_callbacks ( child_callback_type ( kind , child ) ) do _mongoid_run_child_callbacks ( kind , children : tail , & block ) end end end
Run the callbacks for embedded documents.
Run the callbacks for embedded documents .
kind
<not_specific>
children
<not_specific>
block
<not_specific>
<not_specific>
children Children to exeute callbacks on. If nil, callbacks will be executed on all cascadable children of the document.
children Children to exeute callbacks on . If nil callbacks will be executed on all cascadable children of the document .
api
None