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:
parent
f095633f2f
commit
84d380c677
@ -722,9 +722,13 @@ 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
|
||||
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
|
||||
|
||||
# Return true if the issue is closed, otherwise false
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user