method
build_constraint
v3.2.13 -
Show latest stable
- Class:
ActiveRecord::Associations::JoinDependency::JoinAssociation
build_constraint(reflection, table, key, foreign_table, foreign_key)public
No documentation available.
# File activerecord/lib/active_record/associations/join_dependency/join_association.rb, line 111
def build_constraint(reflection, table, key, foreign_table, foreign_key)
constraint = table[key].eq(foreign_table[foreign_key])
if reflection.klass.finder_needs_type_condition?
constraint = table.create_and([
constraint,
reflection.klass.send(:type_condition, table)
])
end
constraint
end