Class: Torque::PostgreSQL::Reflection::BelongsToManyReflection

Inherits:
ActiveRecord::Reflection::AssociationReflection
  • Object
show all
Defined in:
lib/torque/postgresql/reflection/belongs_to_many_reflection.rb

Instance Method Summary collapse

Instance Method Details

#active_record_primary_keyObject



29
30
31
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 29

def active_record_primary_key
  @active_record_primary_key ||= options[:foreign_key] || derive_primary_key
end

#association_classObject



17
18
19
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 17

def association_class
  Associations::BelongsToManyAssociation
end

#association_foreign_keyObject



25
26
27
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 25

def association_foreign_key
  @association_foreign_key ||= foreign_key
end

#collection?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 13

def collection?
  true
end

#connected_through_array?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 9

def connected_through_array?
  true
end

#foreign_keyObject



21
22
23
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 21

def foreign_key
  @foreign_key ||= options[:primary_key] || derive_foreign_key.freeze
end

#macroObject



5
6
7
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 5

def macro
  :belongs_to_many
end