1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-20 15:31:12 +00:00

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
This commit is contained in:
Jean-Philippe Lang 2014-11-08 11:17:45 +00:00
parent f095633f2f
commit 84d380c677

View File

@ -722,9 +722,13 @@ class Issue < ActiveRecord::Base
# Returns the initial status of the issue # Returns the initial status of the issue
# Returns nil for a new issue # Returns nil for a new issue
def status_was def status_was
if status_id_was && status_id_was.to_i > 0 if status_id_changed?
if status_id_was.to_i > 0
@status_was ||= IssueStatus.find_by_id(status_id_was) @status_was ||= IssueStatus.find_by_id(status_id_was)
end end
else
@status_was ||= status
end
end end
# Return true if the issue is closed, otherwise false # Return true if the issue is closed, otherwise false