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/association_proxy.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/association_proxy.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/association_proxy.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_proxy.rb b/activerecord/lib/active_record/associations/association_proxy.rb index 676c4ace61..241b9bfee0 100644 --- a/activerecord/lib/active_record/associations/association_proxy.rb +++ b/activerecord/lib/active_record/associations/association_proxy.rb @@ -169,8 +169,8 @@ module ActiveRecord end # Forwards the call to the reflection class. - def sanitize_sql(sql) - @reflection.klass.send(:sanitize_sql, sql) + def sanitize_sql(sql, table_name = @reflection.klass.quoted_table_name) + @reflection.klass.send(:sanitize_sql, sql, table_name) end # Assigns the ID of the owner to the corresponding foreign key in +record+. |