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

@ -9,6 +9,7 @@ class UserSearch
@topic_id = opts[:topic_id]
@topic_allowed_users = opts[:topic_allowed_users]
@searching_user = opts[:searching_user]
@include_staged_users = opts[:include_staged_users] || false
@limit = opts[:limit] || 20
@group = opts[:group]
@guardian = Guardian.new(@searching_user)
@ -16,7 +17,8 @@ class UserSearch
end
def scoped_users
users = User.where(active: true, staged: false)
users = User.where(active: true)
users = users.where(staged: false) unless @include_staged_users
if @group
users = users.where('users.id IN (