Class: ROM::Associations::ManyToMany
- Defined in:
- core/lib/rom/associations/many_to_many.rb
Overview
Abstract many-to-many association type
Direct Known Subclasses
Instance Attribute Summary collapse
- #join_relation ⇒ Object readonly
Instance Method Summary collapse
-
#call ⇒ Object
abstract
Adapters should implement this method.
-
#foreign_key ⇒ Symbol
Return configured or inferred FK name.
-
#through ⇒ Symbol
Return join-relation name.
Instance Attribute Details
#join_relation ⇒ Object (readonly)
14 15 16 |
# File 'core/lib/rom/associations/many_to_many.rb', line 14 def join_relation @join_relation end |
Instance Method Details
#call ⇒ Object
This method is abstract.
Adapters should implement this method
28 29 30 |
# File 'core/lib/rom/associations/many_to_many.rb', line 28 def call(*) raise NotImplementedError end |
#foreign_key ⇒ Symbol
Return configured or inferred FK name
37 38 39 |
# File 'core/lib/rom/associations/many_to_many.rb', line 37 def foreign_key definition.foreign_key || join_relation.foreign_key(source.name) end |
#through ⇒ Symbol
Return join-relation name
46 47 48 |
# File 'core/lib/rom/associations/many_to_many.rb', line 46 def through definition.through end |