diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-08 11:17:45 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-11-08 11:17:45 +0000 |
commit | 84d380c6772dadef67e8b513c030ae7cd30d985b (patch) | |
tree | 9479f1112d0ae6535f35480752ddb3b2c616deb3 | |
parent | f095633f2feb48d917ea7523f7b05c42592914c4 (diff) | |
download | redmine-84d380c6772dadef67e8b513c030ae7cd30d985b.tar.gz redmine-84d380c6772dadef67e8b513c030ae7cd30d985b.zip |
Prevents a status load in #status_was when status is not changed (#18290).
git-svn-id: http://svn.redmine.org/redmine/trunk@13577 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/models/issue.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb index b337cd561..78383fcd0 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -722,8 +722,12 @@ class Issue < ActiveRecord::Base # Returns the initial status of the issue # Returns nil for a new issue def status_was - if status_id_was && status_id_was.to_i > 0 - @status_was ||= IssueStatus.find_by_id(status_id_was) + if status_id_changed? + if status_id_was.to_i > 0 + @status_was ||= IssueStatus.find_by_id(status_id_was) + end + else + @status_was ||= status end end |