method
build_through_conditions
v3.0.0 -
Show latest stable
- Class:
ActiveRecord::Associations::ThroughAssociationScope
build_through_conditions()protected
No documentation available.
# File activerecord/lib/active_record/associations/through_association_scope.rb, line 136
def build_through_conditions
conditions = @reflection.through_reflection.options[:conditions]
if conditions.is_a?(Hash)
interpolate_sql(@reflection.through_reflection.klass.send(:sanitize_sql, conditions)).gsub(
@reflection.quoted_table_name,
@reflection.through_reflection.quoted_table_name)
elsif conditions
interpolate_sql(sanitize_sql(conditions))
end
end