summaryrefslogtreecommitdiff
path: root/app/finders/issuable_finder.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-03-23 16:44:09 +0000
committerPhil Hughes <me@iamphill.com>2016-03-29 11:57:04 +0100
commit7ff6af19cc2d0f300a184de3887e4e5163bc9a00 (patch)
tree0a27ae9bf8b185ae657c7624aec31ad94f23453f /app/finders/issuable_finder.rb
parentf4238634d3a2661ef5998d3c0df6a6fb90174013 (diff)
downloadgitlab-ce-7ff6af19cc2d0f300a184de3887e4e5163bc9a00.tar.gz
Dropdown bug fixes
Added back upcoming to milestone filter Fixed bug that would cause the currently selected value to disappear on filters Fixed bug that throw an error when filtering by upcoming when there is only a milestone in the past
Diffstat (limited to 'app/finders/issuable_finder.rb')
-rw-r--r--app/finders/issuable_finder.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 046286dd9e1..a7799b91eb8 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -243,7 +243,7 @@ class IssuableFinder
end
def filter_by_upcoming_milestone?
- params[:milestone_title] == '#upcoming'
+ params[:milestone_title] == 'Upcoming'
end
def by_milestone(items)
@@ -252,7 +252,7 @@ class IssuableFinder
items = items.where(milestone_id: [-1, nil])
elsif filter_by_upcoming_milestone?
upcoming = Milestone.where(project_id: projects).upcoming
- items = items.joins(:milestone).where(milestones: { title: upcoming.title })
+ items = items.joins(:milestone).where(milestones: { title: upcoming.try(:title) })
else
items = items.joins(:milestone).where(milestones: { title: params[:milestone_title] })