summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-08 11:17:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-11-08 11:17:45 +0000
commit84d380c6772dadef67e8b513c030ae7cd30d985b (patch)
tree9479f1112d0ae6535f35480752ddb3b2c616deb3
parentf095633f2feb48d917ea7523f7b05c42592914c4 (diff)
downloadredmine-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.rb8
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