diff options
author | Sean McGivern <sean@gitlab.com> | 2017-03-10 22:01:05 +0300 |
---|---|---|
committer | Sean McGivern <sean@gitlab.com> | 2017-03-15 20:02:38 +0300 |
commit | 03dabc522e937f091ad30cc40034ffd6d19c7011 (patch) | |
tree | 683abccc734faf19b6f630ac8e26d8c50a9e64b2 /app/finders/issuable_finder.rb | |
parent | 101fddfa9203fbcc96151e880a3a1241338a91f2 (diff) |
Allow filtering by all started milestones
Diffstat (limited to 'app/finders/issuable_finder.rb')
-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) |