summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorDominik Sander <git@dsander.de>2015-04-30 23:29:00 +0200
committerDominik Sander <git@dsander.de>2015-05-01 01:12:58 +0200
commite6ee8d0ebebc217e247558507eac619931a47121 (patch)
tree5b313baddb457928d5fdc23136b86761c87fea34 /app/finders
parent8d17e79d1dfc8fb415b3fe4dbabd11659fa6c42e (diff)
downloadgitlab-ce-e6ee8d0ebebc217e247558507eac619931a47121.tar.gz
Group milestones by title in the dashboard and all other issue views
This groups milestones by title for issue views like it has been done for the milestone dashboard/project overview. Before milestones with the same title would show up multiple times in the filter dropdown and one could only filter per project and milestone. Now the milestone filter is based on the title of the milestone, i.e. all issues marked with the same milestone title are shown.
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 2c0702073d4..b8f367c6339 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -113,8 +113,9 @@ class IssuableFinder
end
def by_milestone(items)
- if params[:milestone_id].present?
- items = items.where(milestone_id: (params[:milestone_id] == NONE ? nil : params[:milestone_id]))
+ if params[:milestone_title].present?
+ milestone_ids = (params[:milestone_title] == NONE ? nil : Milestone.where(title: params[:milestone_title]).pluck(:id))
+ items = items.where(milestone_id: milestone_ids)
end
items