class Mongoid::Association::Embedded::EmbedsMany::Binding

Binding class for all embeds_many associations.

def bind_one(doc)

Parameters:
  • doc (Document) -- The single document to bind.

Other tags:
    Example: Bind one document. -
def bind_one(doc)
  doc.parentize(_base)
  binding do
    remove_associated(doc)
    doc.do_or_do_not(_association.inverse_setter(_target), _base)
  end
end

def unbind_one(doc)

Parameters:
  • doc (Document) -- The single document to unbind.

Other tags:
    Example: Unbind the document. -
def unbind_one(doc)
  binding do
    doc.do_or_do_not(_association.inverse_setter(_target), nil)
  end
end