rewrite the item.respond_to?(:x?) && item.x? to item.try(:x?)

This commit is contained in:
dimitrieh 2017-01-03 11:30:58 +01:00
parent de25604fbc
commit 52709c6c8b
1 changed files with 3 additions and 3 deletions

View File

@ -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'