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
- #belongs_to? ⇒ Boolean
- #collection? ⇒ Boolean
- #connected_through_array? ⇒ Boolean
- #foreign_key ⇒ Object
- #join_foreign_key ⇒ Object
- #join_primary_key ⇒ Object
- #macro ⇒ Object
Instance Method Details
#active_record_primary_key ⇒ Object
35 36 37 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 35 def active_record_primary_key @active_record_primary_key ||= [:primary_key]&.to_s || derive_primary_key end |
#association_class ⇒ Object
23 24 25 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 23 def association_class Associations::BelongsToManyAssociation end |
#association_foreign_key ⇒ Object
31 32 33 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 31 def association_foreign_key @association_foreign_key ||= foreign_key end |
#belongs_to? ⇒ Boolean
15 16 17 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 15 def belongs_to? true end |
#collection? ⇒ Boolean
19 20 21 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 19 def collection? true end |
#connected_through_array? ⇒ Boolean
11 12 13 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 11 def connected_through_array? true end |
#foreign_key ⇒ Object
27 28 29 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 27 def foreign_key @foreign_key ||= [:foreign_key]&.to_s || derive_foreign_key.freeze end |
#join_foreign_key ⇒ Object
43 44 45 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 43 def join_foreign_key foreign_key end |
#join_primary_key ⇒ Object
39 40 41 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 39 def join_primary_key(*) active_record_primary_key end |
#macro ⇒ Object
7 8 9 |
# File 'lib/torque/postgresql/reflection/belongs_to_many_reflection.rb', line 7 def macro :belongs_to_many end |