Module: Torque::PostgreSQL::Reflection::AssociationReflection

Included in:
ActiveRecord::Reflection::AssociationReflection
Defined in:
lib/torque/postgresql/reflection/association_reflection.rb,
sig/torque/postgresql/reflection/association_reflection.rbs

Instance Method Summary collapse

Instance Method Details

#initialize(name, scope, options, active_record) ⇒ AssociationReflection

Returns a new instance of AssociationReflection.

Parameters:

  • name (Symbol)
  • scope (Proc, nil)
  • options (Hash[Symbol, untyped])
  • active_record (model)

Returns:

Raises:

  • (ArgumentError)


8
9
10
11
12
13
14
15
# File 'lib/torque/postgresql/reflection/association_reflection.rb', line 8

def initialize(name, scope, options, active_record)
  super

  raise ArgumentError, <<-MSG.squish if options[:array] && options[:polymorphic]
    Associations can't be connected through an array at the same time they are
    polymorphic. Please choose one of the options.
  MSG
end