Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d1ece3f8
Commit
d1ece3f8
authored
Jul 27, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract EE-specific lines from issuable finders
parent
0e92a772
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
32 deletions
+27
-32
app/finders/issues_finder.rb
app/finders/issues_finder.rb
+1
-20
app/finders/merge_requests_finder.rb
app/finders/merge_requests_finder.rb
+0
-12
ee/app/finders/ee/issues_finder.rb
ee/app/finders/ee/issues_finder.rb
+26
-0
No files found.
app/finders/issues_finder.rb
View file @
d1ece3f8
...
...
@@ -128,13 +128,7 @@ class IssuesFinder < IssuableFinder
end
def
by_assignee
(
items
)
if
assignees
.
any?
assignees
.
each
do
|
assignee
|
items
=
items
.
assigned_to
(
assignee
)
end
items
elsif
assignee
&&
assignees
.
empty?
if
assignee
items
.
assigned_to
(
assignee
)
elsif
no_assignee?
items
.
unassigned
...
...
@@ -144,17 +138,4 @@ class IssuesFinder < IssuableFinder
items
end
end
def
assignees
return
@assignees
if
defined?
(
@assignees
)
@assignees
=
if
params
[
:assignee_ids
]
User
.
where
(
id:
params
[
:assignee_ids
])
elsif
params
[
:assignee_username
]
User
.
where
(
username:
params
[
:assignee_username
])
else
[]
end
end
end
app/finders/merge_requests_finder.rb
View file @
d1ece3f8
...
...
@@ -37,18 +37,6 @@ class MergeRequestsFinder < IssuableFinder
private
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
items
end
def
source_branch
@source_branch
||=
params
[
:source_branch
].
presence
end
...
...
ee/app/finders/ee/issues_finder.rb
View file @
d1ece3f8
...
...
@@ -2,6 +2,7 @@ module EE
module
IssuesFinder
extend
ActiveSupport
::
Concern
extend
::
Gitlab
::
Utils
::
Override
include
::
Gitlab
::
Utils
::
StrongMemoize
module
ClassMethods
extend
::
Gitlab
::
Utils
::
Override
...
...
@@ -42,5 +43,30 @@ module EE
def
filter_by_any_weight?
params
[
:weight
]
==
::
Issue
::
WEIGHT_ANY
end
override
:by_assignee
def
by_assignee
(
items
)
if
assignees
.
any?
assignees
.
each
do
|
assignee
|
items
=
items
.
assigned_to
(
assignee
)
end
return
items
end
super
end
def
assignees
strong_memoize
(
:assignees
)
do
if
params
[
:assignee_ids
]
::
User
.
where
(
id:
params
[
:assignee_ids
])
elsif
params
[
:assignee_username
]
::
User
.
where
(
username:
params
[
:assignee_username
])
else
[]
end
end
end
end
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