Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
Diffstat (limited to 'app')
-rw-r--r--app/finders/issuable_finder.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/finders/issuable_finder.rb b/app/finders/issuable_finder.rb
index dce756544e7..5ffaf5ae0f8 100644
--- a/app/finders/issuable_finder.rb
+++ b/app/finders/issuable_finder.rb
@@ -173,6 +173,10 @@ class IssuableFinder
params[:assignee_username].present? && params[:assignee_username] != NONE
end
+ def no_assignee?
+ params[:assignee_id] == NONE || params[:assignee_username] == NONE
+ end
+
def assignee
return @assignee if defined?(@assignee)
@@ -194,6 +198,10 @@ class IssuableFinder
params[:author_username].present? && params[:author_username] != NONE
end
+ def no_author?
+ params[:author_id] == NONE || params[:author_username] == NONE
+ end
+
def author
return @author if defined?(@author)
@@ -277,6 +285,8 @@ class IssuableFinder
def by_assignee(items)
if assignee
items = items.where(assignee_id: assignee.id)
+ elsif no_assignee?
+ items = items.where(assignee_id: nil)
elsif assignee_id? || assignee_username? # assignee not found
items = items.none
end
@@ -287,6 +297,8 @@ class IssuableFinder
def by_author(items)
if author
items = items.where(author_id: author.id)
+ elsif no_author?
+ items = items.where(author_id: nil)
elsif author_id? || author_username? # author not found
items = items.none
end