diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 13:51:11 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 13:51:11 +0100 |
commit | 489abfd3b23f3c4b3de86aeb3bde3970771c001b (patch) | |
tree | 49eb51b0702d088302cf592b99c391528246fc96 /activerecord/lib/active_record/associations.rb | |
parent | 7ce0778a1516110cf8015e59e2e8fac15032379c (diff) | |
download | rails-489abfd3b23f3c4b3de86aeb3bde3970771c001b.tar.gz rails-489abfd3b23f3c4b3de86aeb3bde3970771c001b.tar.bz2 rails-489abfd3b23f3c4b3de86aeb3bde3970771c001b.zip |
Ensure JoinAssociation uses aliased table name when multiple associations have hash conditions on the same table
Diffstat (limited to 'activerecord/lib/active_record/associations.rb')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 53a710537f..fa18822c24 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -2123,7 +2123,7 @@ module ActiveRecord klass.send(:type_condition, aliased_table_name)] unless klass.descends_from_active_record? [through_reflection, reflection].each do |ref| - join << "AND #{interpolate_sql(sanitize_sql(ref.options[:conditions]))} " if ref && ref.options[:conditions] + join << "AND #{interpolate_sql(sanitize_sql(ref.options[:conditions], aliased_table_name))} " if ref && ref.options[:conditions] end join |