BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
f7f9e580
Commit
f7f9e580
authored
Dec 16, 2016
by
Lin Jen-Shin
Committed by
Clement Ho
Jan 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure we could query against no one
We should separate the idea of not finding anyone, and the idea of against no one.
parent
23d43243
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
issuable_finder.rb
app/finders/issuable_finder.rb
+12
-0
No files found.
app/finders/issuable_finder.rb
View file @
f7f9e580
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment