From cd64471bdbac70e2505cca9acb622332ebd3a5f9 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sun, 7 Oct 2007 05:05:12 +0000 Subject: Fix calling .clear on a has_many :dependent=>:delete_all association. [tarmo] Closes #6904 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7767 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/lib/active_record/associations/association_collection.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord/lib/active_record') diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index 66ee712d7d..5598d6daa7 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -67,7 +67,7 @@ module ActiveRecord def clear return self if length.zero? # forces load_target if it hasn't happened already - if @reflection.options[:dependent] && @reflection.options[:dependent] == :delete_all + if @reflection.options[:dependent] && @reflection.options[:dependent] == :destroy destroy_all else delete_all -- cgit v1.2.3