]> source.dussan.org Git - redmine.git/commitdiff
Fixed: news comments not deleted when deleting a project (#7904).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 20 Mar 2011 20:26:59 +0000 (20:26 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 20 Mar 2011 20:26:59 +0000 (20:26 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5176 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/project.rb
test/unit/project_test.rb

index 0de3f0e9cb888d0f9559adca0244af8491d4a88a..ccb411482a98da22aff55a8b545fe8b51acaf517 100644 (file)
@@ -43,7 +43,7 @@ class Project < ActiveRecord::Base
   has_many :time_entries, :dependent => :delete_all
   has_many :queries, :dependent => :delete_all
   has_many :documents, :dependent => :destroy
-  has_many :news, :dependent => :delete_all, :include => :author
+  has_many :news, :dependent => :destroy, :include => :author
   has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
   has_many :boards, :dependent => :destroy, :order => "position ASC"
   has_one :repository, :dependent => :destroy
index 6f5878d2eaff62e7ba826c5bd32c456576f56d9c..ba61db49c9ac5dff98fc87ed5db9a4d9162ad7ab 100644 (file)
@@ -204,7 +204,7 @@ class ProjectTest < ActiveSupport::TestCase
     assert_equal 0, Repository.count
     assert_equal 0, Changeset.count
     assert_equal 0, Change.count
-    #assert_equal 0, Comment.count
+    assert_equal 0, Comment.count
     assert_equal 0, TimeEntry.count
     assert_equal 0, Version.count
     assert_equal 0, Watcher.count