diff options
author | Sean McGivern <sean@gitlab.com> | 2017-03-10 19:01:05 +0000 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-03-15 17:02:38 +0000 |
commit | 03dabc522e937f091ad30cc40034ffd6d19c7011 (patch) | |
tree | 683abccc734faf19b6f630ac8e26d8c50a9e64b2 /app/finders | |
parent | 101fddfa9203fbcc96151e880a3a1241338a91f2 (diff) | |
download | gitlab-ce-03dabc522e937f091ad30cc40034ffd6d19c7011.tar.gz |
Allow filtering by all started milestonesbetter-priority-sorting
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 2fca012252e..f7ebb1807d7 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -310,6 +310,10 @@ class IssuableFinder params[:milestone_title] == Milestone::Upcoming.name end + def filter_by_started_milestone? + params[:milestone_title] == Milestone::Started.name + end + def by_milestone(items) if milestones? if filter_by_no_milestone? @@ -317,6 +321,8 @@ class IssuableFinder elsif filter_by_upcoming_milestone? upcoming_ids = Milestone.upcoming_ids_by_projects(projects(items)) items = items.left_joins_milestones.where(milestone_id: upcoming_ids) + elsif filter_by_started_milestone? + items = items.left_joins_milestones.where('milestones.start_date <= NOW()') else items = items.with_milestone(params[:milestone_title]) items_projects = projects(items) |