Class: Torque::PostgreSQL::Reflection::BelongsToManyReflection
- Inherits:
-
ActiveRecord::Reflection::AssociationReflection
- Object
- ActiveRecord::Reflection::AssociationReflection
- Torque::PostgreSQL::Reflection::BelongsToManyReflection
- Defined in:
- lib/torque/postgresql/reflection/belongs_to_many_reflection.rb
Instance Method Summary collapse
- #active_record_primary_key ⇒ Object
- #association_class ⇒ Object
- #association_foreign_key ⇒ Object
- #collection? ⇒ Boolean
- #connected_through_array? ⇒ Boolean
- #foreign_key ⇒ Object
- #macro ⇒ Object
Instance Method Details
#active_record_primary_key ⇒ Object
29 30 31 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 29 def active_record_primary_key @active_record_primary_key ||= [:foreign_key] || derive_primary_key end |
#association_class ⇒ Object
17 18 19 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 17 def association_class Associations::BelongsToManyAssociation end |
#association_foreign_key ⇒ Object
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
13 14 15 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 13 def collection? true end |
#connected_through_array? ⇒ Boolean
9 10 11 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 9 def connected_through_array? true end |
#foreign_key ⇒ Object
21 22 23 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 21 def foreign_key @foreign_key ||= [:primary_key] || derive_foreign_key.freeze end |
#macro ⇒ Object
5 6 7 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 5 def macro :belongs_to_many end |