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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
787cbc89
Commit
787cbc89
authored
Feb 04, 2019
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce diff with EE in Search::GlobalService
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
068b4127
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
app/services/search/global_service.rb
app/services/search/global_service.rb
+10
-4
No files found.
app/services/search/global_service.rb
View file @
787cbc89
...
...
@@ -2,6 +2,8 @@
module
Search
class
GlobalService
include
Gitlab
::
Utils
::
StrongMemoize
attr_accessor
:current_user
,
:params
attr_reader
:default_project_filter
...
...
@@ -19,11 +21,15 @@ module Search
@projects
||=
ProjectsFinder
.
new
(
current_user:
current_user
).
execute
end
def
scope
@scope
||=
begin
allowed_scopes
=
%w[issues merge_requests milestones]
def
allowed_scopes
strong_memoize
(
:allowed_scopes
)
do
%w[issues merge_requests milestones]
end
end
allowed_scopes
.
delete
(
params
[
:scope
])
{
'projects'
}
def
scope
strong_memoize
(
:scope
)
do
allowed_scopes
.
include?
(
params
[
:scope
])
?
params
[
:scope
]
:
'projects'
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