Flowdock
method

build_constraint

Importance_1
v4.0.2 - Show latest stable - 0 notes - Class: JoinAssociation
build_constraint(reflection, 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

reflection    #=> #<ActiveRecord::Reflection::AssociationReflection @macro=:has_many ...>
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.