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
916fae3a
Commit
916fae3a
authored
Jan 27, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'speed-up-members-dropdown' into 'master'
Don't call `#uniq` on a relation See merge request !8784
parents
b9d841c0
2c40a012
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
app/controllers/autocomplete_controller.rb
app/controllers/autocomplete_controller.rb
+2
-3
No files found.
app/controllers/autocomplete_controller.rb
View file @
916fae3a
...
@@ -18,15 +18,14 @@ class AutocompleteController < ApplicationController
...
@@ -18,15 +18,14 @@ class AutocompleteController < ApplicationController
if
params
[
:search
].
blank?
if
params
[
:search
].
blank?
# Include current user if available to filter by "Me"
# Include current user if available to filter by "Me"
if
params
[
:current_user
].
present?
&&
current_user
if
params
[
:current_user
].
present?
&&
current_user
@users
=
@users
.
where
.
not
(
id:
current_user
.
id
)
@users
=
[
current_user
,
*
@users
]
@users
=
[
current_user
,
*
@users
]
end
end
if
params
[
:author_id
].
present?
if
params
[
:author_id
].
present?
author
=
User
.
find_by_id
(
params
[
:author_id
])
author
=
User
.
find_by_id
(
params
[
:author_id
])
@users
=
[
author
,
*
@users
]
if
author
@users
=
[
author
,
*
@users
]
.
uniq
if
author
end
end
@users
.
uniq!
end
end
render
json:
@users
,
only:
[
:name
,
:username
,
:id
],
methods:
[
:avatar_url
]
render
json:
@users
,
only:
[
:name
,
:username
,
:id
],
methods:
[
:avatar_url
]
...
...
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