Method: Mongoid::Association::Referenced::HasMany::Proxy#initialize

Defined in:
lib/mongoid/association/referenced/has_many/proxy.rb

#initialize(base, target, association) ⇒ Proxy

Instantiate a new references_many association. Will set the foreign key and the base on the inverse object.

Examples:

Create the new association.

Referenced::Many.new(base, target, association)

Parameters:



51
52
53
54
55
56
# File 'lib/mongoid/association/referenced/has_many/proxy.rb', line 51

def initialize(base, target, association)
  enum = HasMany::Enumerable.new(target, base, association)
  super(base, enum, association) do
    raise_mixed if klass.embedded? && !klass.cyclic?
  end
end