diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 18:12:40 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-04-20 18:12:40 +0100 |
commit | de0ea3866370ec61581f910cf393a3cc97eba32f (patch) | |
tree | b32efb2bea337b96c875ac5e78c39760c5e663bf /activerecord/lib | |
parent | 489abfd3b23f3c4b3de86aeb3bde3970771c001b (diff) | |
download | rails-de0ea3866370ec61581f910cf393a3cc97eba32f.tar.gz rails-de0ea3866370ec61581f910cf393a3cc97eba32f.tar.bz2 rails-de0ea3866370ec61581f910cf393a3cc97eba32f.zip |
Ensure :dependent => :delete_all works for association with hash conditions
Diffstat (limited to 'activerecord/lib')
-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 fa18822c24..2115878e32 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1375,7 +1375,7 @@ module ActiveRecord dependent_conditions = [] dependent_conditions << "#{reflection.primary_key_name} = \#{record.quoted_id}" dependent_conditions << "#{reflection.options[:as]}_type = '#{base_class.name}'" if reflection.options[:as] - dependent_conditions << sanitize_sql(reflection.options[:conditions]) if reflection.options[:conditions] + dependent_conditions << sanitize_sql(reflection.options[:conditions], reflection.quoted_table_name) if reflection.options[:conditions] dependent_conditions << extra_conditions if extra_conditions dependent_conditions = dependent_conditions.collect {|where| "(#{where})" }.join(" AND ") dependent_conditions = dependent_conditions.gsub('@', '\@') |