method

build_join_constraint

rails latest stable - Class: ActiveRecord::Reflection::AbstractReflection

Method deprecated or moved

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

build_join_constraint(table, foreign_table)
public

No documentation available.

# File activerecord/lib/active_record/reflection.rb, line 177
      def build_join_constraint(table, foreign_table)
        key         = join_keys.key
        foreign_key = join_keys.foreign_key

        constraint = table[key].eq(foreign_table[foreign_key])

        if klass.finder_needs_type_condition?
          table.create_and([constraint, klass.send(:type_condition, table)])
        else
          constraint
        end
      end