summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-24 21:40:26 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2014-10-24 21:40:26 +0000
commitd62574badb1dd49986abf83bfef88f60d1b504b6 (patch)
tree68afcefda6280e6aad36365575e21a69ddb6da82
parent67c4936908e6bc9ac613b41d3ae00b48a4801daf (diff)
downloadredmine-d62574badb1dd49986abf83bfef88f60d1b504b6.tar.gz
redmine-d62574badb1dd49986abf83bfef88f60d1b504b6.zip
Code cleanup, use safer #closed?
git-svn-id: http://svn.redmine.org/redmine/trunk@13505 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/models/issue.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/issue.rb b/app/models/issue.rb
index 462d7d99f..910359bf5 100644
--- a/app/models/issue.rb
+++ b/app/models/issue.rb
@@ -688,7 +688,7 @@ class Issue < ActiveRecord::Base
# Return true if the issue is closed, otherwise false
def closed?
- self.status.is_closed?
+ status.present? && status.is_closed?
end
# Return true if the issue is being reopened
@@ -706,7 +706,7 @@ class Issue < ActiveRecord::Base
# Return true if the issue is being closed
def closing?
if !new_record? && status_id_changed?
- if status_was && status && !status_was.is_closed? && status.is_closed?
+ if closed? && status_was && !status_was.is_closed?
return true
end
end