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
a68c991c
Commit
a68c991c
authored
Nov 01, 2018
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove instance autocomplete_service variable
parent
d0c58a97
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
app/controllers/projects/autocomplete_sources_controller.rb
app/controllers/projects/autocomplete_sources_controller.rb
+8
-10
No files found.
app/controllers/projects/autocomplete_sources_controller.rb
View file @
a68c991c
# frozen_string_literal: true
# frozen_string_literal: true
class
Projects::AutocompleteSourcesController
<
Projects
::
ApplicationController
class
Projects::AutocompleteSourcesController
<
Projects
::
ApplicationController
before_action
:load_autocomplete_service
,
except:
[
:members
]
def
members
def
members
render
json:
::
Projects
::
ParticipantsService
.
new
(
@project
,
current_user
).
execute
(
target
)
render
json:
::
Projects
::
ParticipantsService
.
new
(
@project
,
current_user
).
execute
(
target
)
end
end
def
issues
def
issues
render
json:
@
autocomplete_service
.
issues
render
json:
autocomplete_service
.
issues
end
end
def
merge_requests
def
merge_requests
render
json:
@
autocomplete_service
.
merge_requests
render
json:
autocomplete_service
.
merge_requests
end
end
def
labels
def
labels
render
json:
@
autocomplete_service
.
labels_as_hash
(
target
)
render
json:
autocomplete_service
.
labels_as_hash
(
target
)
end
end
def
milestones
def
milestones
render
json:
@
autocomplete_service
.
milestones
render
json:
autocomplete_service
.
milestones
end
end
def
commands
def
commands
render
json:
@
autocomplete_service
.
commands
(
target
,
params
[
:type
])
render
json:
autocomplete_service
.
commands
(
target
,
params
[
:type
])
end
end
def
snippets
def
snippets
render
json:
@
autocomplete_service
.
snippets
render
json:
autocomplete_service
.
snippets
end
end
private
private
def
load_
autocomplete_service
def
autocomplete_service
@autocomplete_service
=
::
Projects
::
AutocompleteService
.
new
(
@project
,
current_user
)
@autocomplete_service
||
=
::
Projects
::
AutocompleteService
.
new
(
@project
,
current_user
)
end
end
def
target
def
target
...
...
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