diff options
author | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-02-02 19:33:33 +0000 |
---|---|---|
committer | Achilleas Pipinellis <axilleas@axilleas.me> | 2017-02-02 19:33:33 +0000 |
commit | c846d3610912bed47404b31c5bc2f190ecbdb93b (patch) | |
tree | dd98634af5c2796a6435afe6c1e2a7254d981c8b /app/controllers/autocomplete_controller.rb | |
parent | bb06183d3d8725b328d9f6f05bf5c4a74b93fb36 (diff) | |
parent | b2e5c423d7080644132c70650bc707feb41cd5a9 (diff) | |
download | gitlab-ce-update-import-export-docs.tar.gz |
Merge branch 'master' into 'update-import-export-docs'update-import-export-docs
# Conflicts:
# doc/user/project/settings/import_export.md
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r-- | app/controllers/autocomplete_controller.rb | 5 |
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] |