FEATURE: user directory returns staged users during search

This commit is contained in:
Gerhard Schlager
2017-11-19 01:17:31 +01:00
parent 546b206da0
commit 92a831bae6
5 changed files with 90 additions and 53 deletions

View File

@ -23,7 +23,7 @@ class DirectoryItemsController < ApplicationController
user_ids = nil
if params[:name].present?
user_ids = UserSearch.new(params[:name]).search.pluck(:id)
user_ids = UserSearch.new(params[:name], include_staged_users: true).search.pluck(:id)
if user_ids.present?
# Add the current user if we have at least one other match
if current_user && result.dup.where(user_id: user_ids).exists?