diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-24 18:07:29 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-07-06 22:39:55 -0400 |
commit | 3ee3cb24d44e8a9a1284fbd0944b9fcfb938c494 (patch) | |
tree | 044374f3ccb2799eec70c6759e5e0c719eed74c5 /app/finders | |
parent | ea565653a06125689cf30326bacfae812e1f2800 (diff) | |
download | gitlab-ce-3ee3cb24d44e8a9a1284fbd0944b9fcfb938c494.tar.gz |
Allow user to filter by Issues/Merge Requests without a Milestone
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index 2eccc0ee31f..872c63d82bd 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -76,7 +76,7 @@ class IssuableFinder return @milestones if defined?(@milestones) @milestones = - if milestones? && params[:milestone_title] != NONE + if milestones? && params[:milestone_title] != NoMilestone.title Milestone.where(title: params[:milestone_title]) else nil @@ -183,7 +183,12 @@ class IssuableFinder def by_milestone(items) if milestones? - items = items.where(milestone_id: milestones.try(:pluck, :id)) + # `milestone_title` will still be present when "No Milestone" is selected + if params[:milestone_title] != NoMilestone.title + items = items.where(milestone_id: milestones.try(:pluck, :id)) + else + items = items.where(milestone_id: NoMilestone.id) + end end items |