Commit 5c0f6c85 authored by Sean McGivern's avatar Sean McGivern

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.
parent 7ac732a2
...@@ -18,8 +18,7 @@ class AutocompleteController < ApplicationController ...@@ -18,8 +18,7 @@ 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].uniq
@users = [current_user, *@users]
end end
if params[:author_id].present? if params[:author_id].present?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment