class Mongoid::Relations::Bindings::Embedded::One

Binding class for embeds_one relations.

def bind_one

Other tags:
    Since: - 2.0.0.rc.1

Options Hash: (**options)
  • :binding (true, false) -- Are we in build mode?
  • :continue (true, false) -- Do we continue binding?

Parameters:
  • options (Hash) -- The options to pass through.

Other tags:
    Example: Bind the document. -
def bind_one
  target.parentize(base)
  binding do
    target.do_or_do_not(metadata.inverse_setter(target), base)
  end
end

def unbind_one

Other tags:
    Since: - 2.0.0.rc.1

Options Hash: (**options)
  • :binding (true, false) -- Are we in build mode?
  • :continue (true, false) -- Do we continue unbinding?

Parameters:
  • options (Hash) -- The options to pass through.

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