Sha256: 36a042927bfea565e27eae62e6ee3b7414c0eba3230b0cf42ed5bca9a5a3bc37

Contents?: true

Size: 595 Bytes

Versions: 19

Compression:

Stored size: 595 Bytes

Contents

module ActiveRecord
  module Associations
    class JoinDependency
      class JoinAssociation
        def build_constraint(klass, table, key, foreign_table, foreign_key)
          # CPK
          # constraint = table[key].eq(foreign_table[foreign_key])
          constraint = cpk_join_predicate(table, key, foreign_table, foreign_key)

          if klass.finder_needs_type_condition?
            constraint = table.create_and([
              constraint,
              klass.send(:type_condition, table)
            ])
          end

          constraint
        end
      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
composite_primary_keys-7.0.15 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-8.1.1 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.14 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-8.1.0 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.13 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-8.0.0 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.12 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.11 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.10 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.9 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.8 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.7 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.6 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.5 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.4 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.3 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.2 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.1 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-7.0.0 lib/composite_primary_keys/associations/join_dependency/join_association.rb