Fixed: ActiveRecord::StaleObjectError exception on closing a set of circular duplicate issues (#1105).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@1360 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2008-04-26 10:54:46 +00:00
parent 76b92fb999
commit 1d570a40ff
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -153,6 +153,8 @@ class Issue < ActiveRecord::Base
# Close duplicates if the issue was closed
if @issue_before_change && !@issue_before_change.closed? && self.closed?
duplicates.each do |duplicate|
# Reload is need in case the duplicate was updated by a previous duplicate
duplicate.reload
# Don't re-close it if it's already closed
next if duplicate.closed?
# Same user and notes