diff --git a/app/controllers/admin/users_controller.rb b/app/controllers/admin/users_controller.rb index aada2a82b6d..1f46a9bd810 100644 --- a/app/controllers/admin/users_controller.rb +++ b/app/controllers/admin/users_controller.rb @@ -8,6 +8,11 @@ def index @direction = params[:direction] || 'desc' @target = params[:target] user_scope = User.users_role(@target, allowed_targets: ALLOWED_TARGETS, default_target: 'student_and_trainee') + user_scope = if @target == 'retired' + user_scope.where.not(retired_on: nil) + else + user_scope.where(retired_on: nil) + end @users = user_scope.with_attached_avatar .preload(:company, :course) .order_by_counts(params[:order_by] || 'id', @direction)