Merge pull request #9846 from fbeegle/master

Update autocomplete_controller to be more readable
This commit is contained in:
Dmitriy Zaporozhets 2015-12-02 10:02:15 +01:00
commit 3f5e999fe7

View file

@ -9,7 +9,7 @@ class AutocompleteController < ApplicationController
@users = @users.reorder(:name)
@users = @users.page(params[:page]).per(PER_PAGE)
unless params[:search].present?
if params[:search].blank?
# Include current user if available to filter by "Me"
if params[:current_user] && current_user
@users = [*@users, current_user].uniq