diff options
author | Phil Hughes <me@iamphill.com> | 2016-07-18 11:04:36 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-07-20 12:48:02 +0300 |
commit | 639a0b1985d2a9b22ec78ca9b61a09edaf30d655 (patch) | |
tree | 5e8b77bf03c210d978fc2e9da863813faf1ce966 /app/helpers/milestones_helper.rb | |
parent | c48476646eb07ab5d682fcf0fb7b3255aa16bf1d (diff) |
Fixed milestone dropdown label not persisting
Diffstat (limited to 'app/helpers/milestones_helper.rb')
-rw-r--r-- | app/helpers/milestones_helper.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index 05caf91240f..bc87ac32e3e 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -55,10 +55,14 @@ module MilestonesHelper end end - def milestone_dropdown_selected_text + def milestone_dropdown_selected_text(selected) project = @target_project || @project || @projects - Milestone.of_projects(project).where(title: params[:milestone_title]).first().try(:name) + if selected.is_a? Integer + Milestone.of_projects(project).where(id: selected).first.try(:title) + else + Milestone.of_projects(project).where(title: selected).first.try(:title) + end end def milestone_remaining_days(milestone) |