diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 20:37:52 +0800 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-11-01 07:39:45 +0800 |
commit | e5a09709ea7c3104d5aad141132caabde097e1b3 (patch) | |
tree | 55ca57b60fbeea214d54629c81c950801249be48 /app/finders | |
parent | 31733b6fc5a9ba4443a5dd279e787e2fd8e31c6d (diff) | |
download | gitlab-ce-e5a09709ea7c3104d5aad141132caabde097e1b3.tar.gz |
Update API to accept None and Any
Diffstat (limited to 'app/finders')
-rw-r--r-- | app/finders/issuable_finder.rb | 26 |
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? |