diff options
author | Carl Lerche <carllerche@mac.com> | 2010-04-03 09:19:56 -0700 |
---|---|---|
committer | Carl Lerche <carllerche@mac.com> | 2010-04-03 09:22:00 -0700 |
commit | 52ffaa182ea323af120dc5687d7547004167d0da (patch) | |
tree | bc5d4605c772ee301381caf9212cd007db6f984f /activerecord/lib/active_record/associations/through_association_scope.rb | |
parent | 3eb97531b8650db5cc7b9558cc3828c56a526b6a (diff) | |
download | rails-52ffaa182ea323af120dc5687d7547004167d0da.tar.gz rails-52ffaa182ea323af120dc5687d7547004167d0da.tar.bz2 rails-52ffaa182ea323af120dc5687d7547004167d0da.zip |
Sanitize association conditions using the correct class
Diffstat (limited to 'activerecord/lib/active_record/associations/through_association_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/through_association_scope.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |