From e0f0c29b0cfe3c0c97191eeb96eae1299f3983d1 Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Fri, 26 Oct 2018 10:47:14 +0800 Subject: Support lowercase none / any --- app/finders/issuable_finder.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/finders') diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb index ec4472de0c4..eb3d2498830 100644 --- a/app/finders/issuable_finder.rb +++ b/app/finders/issuable_finder.rb @@ -35,8 +35,8 @@ class IssuableFinder requires_cross_project_access unless: -> { project? } # This is used as a common filter for None / Any - FILTER_NONE = 'None'.freeze - FILTER_ANY = 'Any'.freeze + FILTER_NONE = 'none'.freeze + FILTER_ANY = 'any'.freeze # This is accepted as a deprecated filter and is also used in unassigning users NONE = '0'.freeze @@ -250,11 +250,11 @@ class IssuableFinder def filter_by_no_assignee? # Assignee_id takes precedence over assignee_username - [NONE, FILTER_NONE].include?(params[:assignee_id].to_s) || params[:assignee_username].to_s == NONE + [NONE, FILTER_NONE].include?(params[:assignee_id].to_s.downcase) || params[:assignee_username].to_s == NONE end def filter_by_any_assignee? - params[:assignee_id].to_s == FILTER_ANY + params[:assignee_id].to_s.downcase == FILTER_ANY end # rubocop: disable CodeReuse/ActiveRecord -- cgit v1.2.1