Method: Mongoid::Relations::Referenced::In#initialize

Defined in:
lib/mongoid/relations/referenced/in.rb

#initialize(base, target, metadata) ⇒ In

Instantiate a new referenced_in relation.

Examples:

Create the new relation.

Referenced::In.new(game, person, )

Parameters:

  • base (Document)

    The document this relation hangs off of.

  • target (Document, Array<Document>)

    The target (parent) of the relation.

  • metadata (Metadata)

    The relation’s metadata.



21
22
23
24
25
26
# File 'lib/mongoid/relations/referenced/in.rb', line 21

def initialize(base, target, )
  init(base, target, ) do
    characterize_one(target)
    bind_one
  end
end