Simplify user search for external teachers

This commit is contained in:
Sebastian Serth
2022-09-04 19:03:15 +02:00
parent fbe80ac557
commit 1581d658ea
4 changed files with 34 additions and 22 deletions

View File

@ -67,7 +67,7 @@ class InternalUsersController < ApplicationController
end
def index
@search = InternalUser.ransack(params[:q])
@search = InternalUser.ransack(params[:q], {auth_object: current_user})
@users = @search.result.includes(:consumer).order(:name).paginate(page: params[:page], per_page: per_page_param)
authorize!
end