Prevent ActiveRecord::StaleObjectError in Issue#reschedule_after (#7920).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8864 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
+7
-1
@@ -638,7 +638,13 @@ class Issue < ActiveRecord::Base
|
||||
if leaf?
|
||||
if start_date.nil? || start_date < date
|
||||
self.start_date, self.due_date = date, date + duration
|
||||
save
|
||||
begin
|
||||
save
|
||||
rescue ActiveRecord::StaleObjectError
|
||||
reload
|
||||
self.start_date, self.due_date = date, date + duration
|
||||
save
|
||||
end
|
||||
end
|
||||
else
|
||||
leaves.each do |leaf|
|
||||
|
||||
Reference in New Issue
Block a user