Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-01-27 19:58:22 +0300
committerDouwe Maan <douwe@gitlab.com>2017-01-27 19:58:22 +0300
commit916fae3a777a7789f02b906414031cee1a61d7dd (patch)
tree4b06fb8a3cfb099c754dde1073430eb2b806292e /app
parentb9d841c0e2a8b179cbbf99cbf87b311db52c9d3a (diff)
parent2c40a012d63784d1ad91a3629cb1e66ca9ffa96a (diff)
Merge branch 'speed-up-members-dropdown' into 'master'
Don't call `#uniq` on a relation See merge request !8784
Diffstat (limited to 'app')
-rw-r--r--app/controllers/autocomplete_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index 6db4e1dc1bc..d7a45bacd35 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -18,15 +18,14 @@ class AutocompleteController < ApplicationController
if params[:search].blank?
# Include current user if available to filter by "Me"
if params[:current_user].present? && current_user
+ @users = @users.where.not(id: current_user.id)
@users = [current_user, *@users]
end
if params[:author_id].present?
author = User.find_by_id(params[:author_id])
- @users = [author, *@users] if author
+ @users = [author, *@users].uniq if author
end
-
- @users.uniq!
end
render json: @users, only: [:name, :username, :id], methods: [:avatar_url]