Sha256: 8440ebb9020e2ca0a33b5431a93ae458a4561aeac81fce427ba8f82755a0918c
Contents?: true
Size: 746 Bytes
Versions: 9
Compression:
Stored size: 746 Bytes
Contents
module ActiveRecord module Associations module ThroughAssociation alias :original_construct_join_attributes :construct_join_attributes def construct_join_attributes(*records) # CPK if !self.source_reflection.polymorphic? && 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
9 entries across 9 versions & 1 rubygems