diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-12 19:41:42 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-02-12 19:41:42 +0000 |
commit | 7fa18cad5771ea63cb1c55a24ade75a573af5dae (patch) | |
tree | 29c8bb92261bf9a33341f5f43c2e4b530aff4f1f /app/models/issue.rb | |
parent | d289619c757b52849002e0a78ecc4b45065cb8af (diff) | |
download | redmine-7fa18cad5771ea63cb1c55a24ade75a573af5dae.tar.gz redmine-7fa18cad5771ea63cb1c55a24ade75a573af5dae.zip |
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
Diffstat (limited to 'app/models/issue.rb')
-rw-r--r-- | app/models/issue.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index 64a99e6be..2750d7f63 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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| |