summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-01-03 11:49:01 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-01-03 11:49:01 +0000
commitc67e9bb353dee34a86e072436e13a97e18bf6925 (patch)
tree5174abce69fc7a0e35b091cb671915d4c5d58b8e
parented271836e2e6895f304ef1bd4b5548b106875c73 (diff)
parent52709c6c8bb5bb00981a4ed7fa10195c32573ea9 (diff)
downloadgitlab-ce-c67e9bb353dee34a86e072436e13a97e18bf6925.tar.gz
Merge branch 'minor-ruby-status-badge-changes' into 'master'
rewrite the item.respond_to?(:x?) && item.x? to item.try(:x?) See merge request !8409
-rw-r--r--app/helpers/issues_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb
index a8a49e43b05..47c7d2ebbec 100644
--- a/app/helpers/issues_helper.rb
+++ b/app/helpers/issues_helper.rb
@@ -58,13 +58,13 @@ module IssuesHelper
end
def status_box_class(item)
- if item.respond_to?(:expired?) && item.expired?
+ if item.try(:expired?)
'status-box-expired'
- elsif item.respond_to?(:merged?) && item.merged?
+ elsif item.try(:merged?)
'status-box-merged'
elsif item.closed?
'status-box-closed'
- elsif item.respond_to?(:upcoming?) && item.upcoming?
+ elsif item.try(:upcoming?)
'status-box-upcoming'
else
'status-box-open'