def cascadable_children(kind, children = Set.new)
      embedded_relations.each_pair do |name, association|
        next unless association.cascading_callbacks?
        without_autobuild do
          delayed_pulls = delayed_atomic_pulls[name]
          delayed_unsets = delayed_atomic_unsets[name]
          children.merge(delayed_pulls) if delayed_pulls
          children.merge(delayed_unsets) if delayed_unsets
          relation = send(name)
          Array.wrap(relation).each do |child|
            next if children.include?(child)
            children.add(child) if cascadable_child?(kind, child, association)
            child.send(:cascadable_children, kind, children)
          end
        end
      end
      children.to_a
    end
def cascadable_children(kind, children = Set.new)
      embedded_relations.each_pair do |name, association|
        next unless association.cascading_callbacks?
        without_autobuild do
          delayed_pulls = delayed_atomic_pulls[name]
          delayed_unsets = delayed_atomic_unsets[name]
          children.merge(delayed_pulls) if delayed_pulls
          children.merge(delayed_unsets) if delayed_unsets
          relation = send(name)
          Array.wrap(relation).each do |child|
            next if children.include?(child)
            children.add(child) if cascadable_child?(kind, child, association)
            child.send(:cascadable_children, kind, children)
          end
        end
      end
      children.to_a
    end
Get all the child embedded documents that are flagged as cascadable.

 @example Get all the cascading children.
   document.cascadable_children(:update)

 @param [ Symbol ] kind The type of callback.

 @return [ Array<Document> ] The children.

 @since 2.3.0