diff options
author | Phil Hughes <me@iamphill.com> | 2016-03-16 22:14:31 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2016-03-18 18:18:06 +0300 |
commit | d847db79cb6a99d9cfb6f4c57587887942965388 (patch) | |
tree | eab21bec8ff4667ea931e438e7d66a346e62659d /app/helpers/milestones_helper.rb | |
parent | 645b7a0a3389dca3a709f65a52ae765f213078f2 (diff) |
Fixes issue on dashboard issues
They would try to load JSON from a project even though it isn't a single project
Diffstat (limited to 'app/helpers/milestones_helper.rb')
-rw-r--r-- | app/helpers/milestones_helper.rb | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/app/helpers/milestones_helper.rb b/app/helpers/milestones_helper.rb index 92ed0891e92..de60be4eb25 100644 --- a/app/helpers/milestones_helper.rb +++ b/app/helpers/milestones_helper.rb @@ -56,12 +56,15 @@ module MilestonesHelper epoch = DateTime.parse('1970-01-01') grouped_milestones = GlobalMilestone.build_collection(milestones) - grouped_milestones = grouped_milestones.sort_by { |x| x.due_date.nil? ? epoch : x.due_date } - grouped_milestones.unshift(Milestone::None) - grouped_milestones.unshift(Milestone::Any) - grouped_milestones.unshift(Milestone::Upcoming) + grouped_milestones.sort_by { |x| x.due_date.nil? ? epoch : x.due_date } + end - options_from_collection_for_select(grouped_milestones, 'name', 'title', params[:milestone_title]) + def milestones_filter_dropdown_path + if @project + namespace_project_milestones_path(@project.namespace, @project, :json) + else + milestones_dashboard_path(:json) + end end def milestone_remaining_days(milestone) |