From 52ffaa182ea323af120dc5687d7547004167d0da Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Sat, 3 Apr 2010 09:19:56 -0700 Subject: Sanitize association conditions using the correct class --- .../lib/active_record/associations/through_association_scope.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/lib/active_record/associations/through_association_scope.rb b/activerecord/lib/active_record/associations/through_association_scope.rb index 6f0f698f1e..1d2f323112 100644 --- a/activerecord/lib/active_record/associations/through_association_scope.rb +++ b/activerecord/lib/active_record/associations/through_association_scope.rb @@ -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 -- cgit v1.2.3