def child_callback_type(kind, child)
      if kind == :update
        return :create if child.new_record?
        return :destroy if child.flagged_for_destroy?
        kind
      else
        kind
      end
    end
def child_callback_type(kind, child)
      if kind == :update
        return :create if child.new_record?
        return :destroy if child.flagged_for_destroy?
        kind
      else
        kind
      end
    end
Get the name of the callback that the child should fire. This changes
 depending on whether or not the child is new. A persisted parent with a
 new child would fire :update from the parent, but needs to fire :create
 on the child.

 @example Get the callback type.
   document.child_callback_type(:update, doc)

 @param [ Symbol ] kind The type of callback.
 @param [ Document ] child The child document

 @return [ Symbol ] The name of the callback.

 @since 2.3.0