Sha256: a354be84b7a035badea4f059dc93ff54fe238f2e7b6e3feafd545e1094fa8c93

Contents?: true

Size: 683 Bytes

Versions: 17

Compression:

Stored size: 683 Bytes

Contents

module ActiveRecord
  module Associations
    class JoinDependency
      class JoinAssociation
        silence_warnings do
          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
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
composite_primary_keys-10.0.5 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.10 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-10.0.4 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.9 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-10.0.3 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-10.0.2 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-10.0.1 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.8 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-10.0.0 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.7 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.6 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.5 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.4 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.2 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.1 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.0 lib/composite_primary_keys/associations/join_dependency/join_association.rb
composite_primary_keys-9.0.0.beta1 lib/composite_primary_keys/associations/join_dependency/join_association.rb