method

build_constraint

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: JoinAssociation

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v5.1.7) is shown here.

build_constraint(klass, table, key, foreign_table, foreign_key) public

Builds equality condition.

Example:

class Physician < ActiveRecord::Base

has_many :appointments

end

If I execute `Physician.joins(:appointments).to_a` then

klass         # => Physician
table         # => #<Arel::Table @name="appointments" ...>
key           # =>  physician_id
foreign_table # => #<Arel::Table @name="physicians" ...>
foreign_key   # => id
Show source
Register or log in to add new notes.