diff options
author | Frederick Cheung <frederick.cheung@gmail.com> | 2008-12-21 15:38:40 +0000 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-21 15:57:48 +0000 |
commit | b17b9371c6a26484eb1984d45acffcdcd91b1ae1 (patch) | |
tree | f81c502a724e8383faf90d6b28250fd54860e9e5 /activerecord/lib | |
parent | 6f4b2469fb19bb01fa0f53192eb49f8f2d95db1b (diff) | |
download | rails-b17b9371c6a26484eb1984d45acffcdcd91b1ae1.tar.gz rails-b17b9371c6a26484eb1984d45acffcdcd91b1ae1.tar.bz2 rails-b17b9371c6a26484eb1984d45acffcdcd91b1ae1.zip |
Fix configure_dependency_for_has_many not quoting conditions properly [#1461 state:resolved]
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/associations.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index 07bc50c886..5a60b13fd8 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -1453,7 +1453,7 @@ module ActiveRecord dependent_conditions << sanitize_sql(reflection.options[:conditions]) 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('@', '\@') case reflection.options[:dependent] when :destroy method_name = "has_many_dependent_destroy_for_#{reflection.name}".to_sym @@ -1467,7 +1467,7 @@ module ActiveRecord delete_all_has_many_dependencies(record, "#{reflection.name}", #{reflection.class_name}, - "#{dependent_conditions}") + %@#{dependent_conditions}@) end } when :nullify @@ -1477,7 +1477,7 @@ module ActiveRecord "#{reflection.name}", #{reflection.class_name}, "#{reflection.primary_key_name}", - "#{dependent_conditions}") + %@#{dependent_conditions}@) end } else |