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.
This commit is contained in:
parent
7ac732a2b4
commit
5c0f6c856d
1 changed files with 1 additions and 2 deletions
|
@ -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?
|
||||
|
|
Loading…
Reference in a new issue