diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 462bfdb81c06bb9eb02a66e8a253e17dccdc79ed..3709d04e8a24cc6541b9dff4a1c28fe50518835c 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -48,18 +48,11 @@ module IssuablesHelper end def milestone_dropdown_label(milestone_title, default_label) - milestone_title = - if milestone_title == Milestone::Upcoming.name - Milestone::Upcoming.title - else - milestone_title - end - - if !milestone_title.nil? && !milestone_title.empty? - h(milestone_title) - else - default_label + if milestone_title == Milestone::Upcoming.name + milestone_title = Milestone::Upcoming.title end + + h(milestone_title.presence || default_label) end private diff --git a/app/models/global_milestone.rb b/app/models/global_milestone.rb index 9c0e7e4fb63cf216b34a8d7d821f1a57dd75dbbf..da7c265a3718ae7a0c99aecb16a3cae0f457d2df 100644 --- a/app/models/global_milestone.rb +++ b/app/models/global_milestone.rb @@ -8,7 +8,7 @@ class GlobalMilestone milestones = milestones.group_by(&:title) milestones.map do |title, milestones| - new(title, milestones) + new(title, milestones) end end