summaryrefslogtreecommitdiff
path: root/app/finders
diff options
context:
space:
mode:
authorHeinrich Lee Yu <hleeyu@gmail.com>2018-10-26 20:37:52 +0800
committerHeinrich Lee Yu <hleeyu@gmail.com>2018-11-01 07:39:45 +0800
commite5a09709ea7c3104d5aad141132caabde097e1b3 (patch)
tree55ca57b60fbeea214d54629c81c950801249be48 /app/finders
parent31733b6fc5a9ba4443a5dd279e787e2fd8e31c6d (diff)
downloadgitlab-ce-e5a09709ea7c3104d5aad141132caabde097e1b3.tar.gz
Update API to accept None and Any
Diffstat (limited to 'app/finders')
-rw-r--r--app/finders/issuable_finder.rb26
1 files changed, 13 insertions, 13 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index 92aaa9c6b29..4dc8c8b8bb1 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -193,7 +193,19 @@ class IssuableFinder
end
def filter_by_no_milestone?
- milestones? && params[:milestone_title] == Milestone::None.title
+ [FILTER_NONE, Milestone::None.title].include?(params[:milestone_title].to_s.downcase)
+ end
+
+ def filter_by_any_milestone?
+ [FILTER_ANY, Milestone::Any.title].include?(params[:milestone_title].to_s.downcase)
+ end
+
+ def filter_by_upcoming_milestone?
+ params[:milestone_title] == Milestone::Upcoming.name
+ end
+
+ def filter_by_started_milestone?
+ params[:milestone_title] == Milestone::Started.name
end
def milestones
@@ -432,18 +444,6 @@ class IssuableFinder
end
# rubocop: enable CodeReuse/ActiveRecord
- def filter_by_upcoming_milestone?
- params[:milestone_title] == Milestone::Upcoming.name
- end
-
- def filter_by_any_milestone?
- params[:milestone_title] == Milestone::Any.title
- end
-
- def filter_by_started_milestone?
- params[:milestone_title] == Milestone::Started.name
- end
-
# rubocop: disable CodeReuse/ActiveRecord
def by_milestone(items)
if milestones?