def remove_child(child)
      name = child.association_name
      if child.embedded_one?
        remove_ivar(name)
      else
        relation = send(name)
        relation.send(:delete_one, child)
      end
    end
def remove_child(child)
      name = child.association_name
      if child.embedded_one?
        remove_ivar(name)
      else
        relation = send(name)
        relation.send(:delete_one, child)
      end
    end
Remove a child document from this parent. If an embeds one then set to
 nil, otherwise remove from the embeds many.

 This is called from the +RemoveEmbedded+ persistence command.

 @example Remove the child.
   document.remove_child(child)

 @param [ Document ] child The child (embedded) document to remove.

 @since 2.0.0.beta.1