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
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-03-10 14:13:57 +0300
committerSean McGivern <sean@gitlab.com>2017-03-10 14:41:44 +0300
commit5c0f6c856de37b022f5a429b50a1784cf374c45f (patch)
tree8138f05a37503980dd5fb01b3fe0dc926647f590 /app/controllers/autocomplete_controller.rb
parent7ac732a2b4383800d40cfd1af906a07de3df0e7a (diff)
Fix autocomplete in EE when permissions are sent
In EE, `@users` can be an array at the point where we remove the current user, because it can do a permissions check on the users for project mirroring. Fix this in CE by only using array methods, not AR methods. We can't use `delete` because that uses `Object#equal?`, which isn't true in this case.
Diffstat (limited to 'app/controllers/autocomplete_controller.rb')
-rw-r--r--app/controllers/autocomplete_controller.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/app/controllers/autocomplete_controller.rb b/app/controllers/autocomplete_controller.rb
index d7a45bacd35..b79ca034c5b 100644
--- a/app/controllers/autocomplete_controller.rb
+++ b/app/controllers/autocomplete_controller.rb
@@ -18,8 +18,7 @@ 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]
+ @users = [current_user, *@users].uniq
end
if params[:author_id].present?