construct_conditions()
protected
Build SQL conditions
from attributes, qualified by table name.
# File activerecord/lib/active_record/associations/has_many_through_association.rb, line 122
def construct_conditions
table_name = @reflection.through_reflection.quoted_table_name
conditions = construct_quoted_owner_attributes(@reflection.through_reflection).map do |attr, value|
"#{table_name}.#{attr} = #{value}"
end
conditions << sql_conditions if sql_conditions
"(" + conditions.join(') AND (') + ")"
end