method

build_constraint

Importance_0
v3.1.0 - Show latest stable - 0 notes - Class: JoinAssociation
build_constraint(reflection, table, key, foreign_table, foreign_key) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# 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
Register or log in to add new notes.