Sanitize association conditions using the correct class

This commit is contained in:
Carl Lerche
2010-04-03 09:19:56 -07:00
parent 3eb97531b8
commit 52ffaa182e

View File

@@ -135,7 +135,7 @@ module ActiveRecord
def build_through_conditions
conditions = @reflection.through_reflection.options[:conditions]
if conditions.is_a?(Hash)
interpolate_sql(sanitize_sql(conditions)).gsub(
interpolate_sql(@reflection.through_reflection.klass.send(:sanitize_sql, conditions)).gsub(
@reflection.quoted_table_name,
@reflection.through_reflection.quoted_table_name)
elsif conditions