Module: ActiveRecord::Associations::ThroughAssociation
- Defined in:
- lib/composite_primary_keys/associations/through_association.rb
Instance Method Summary collapse
Instance Method Details
#construct_join_attributes(*records) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/composite_primary_keys/associations/through_association.rb', line 6 def construct_join_attributes(*records) # CPK if source_reflection.klass.composite? ensure_mutable ids = records.map do |record| source_reflection.association_primary_key(reflection.klass).map do |key| record.send(key) end end cpk_in_predicate(through_association.scope.klass.arel_table, source_reflection.foreign_key, ids) else original_construct_join_attributes(*records) end end |
#original_construct_join_attributes ⇒ Object
4 |
# File 'lib/composite_primary_keys/associations/through_association.rb', line 4 alias :original_construct_join_attributes :construct_join_attributes |