Sha256: e2298c54c28a6c9324704c710d3edab99290c7df70bc81eb3a53714f17ead5d3
Contents?: true
Size: 706 Bytes
Versions: 10
Compression:
Stored size: 706 Bytes
Contents
module ActiveRecord module Associations module ThroughAssociation alias :original_construct_join_attributes :construct_join_attributes 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 end end end
Version data entries
10 entries across 10 versions & 1 rubygems