From 4810d534eedbfa720ce08fbc516953b2a375e8ba Mon Sep 17 00:00:00 2001 From: nakamurakazuki Date: Fri, 19 Apr 2024 15:55:45 +0900 Subject: [PATCH] =?UTF-8?q?=E9=80=80=E4=BC=9A=E3=81=97=E3=81=9F=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E3=82=B6=E3=83=BC=E3=82=92=E9=80=80=E4=BC=9A=E3=83=A6?= =?UTF-8?q?=E3=83=BC=E3=82=B6=E3=83=BC=E3=81=AB=E8=A1=A8=E7=A4=BA=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=E3=81=97=E3=80=81=E9=80=80?= =?UTF-8?q?=E4=BC=9A=E3=81=97=E3=81=9F=E3=82=A2=E3=83=89=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E3=81=AF=E3=82=A2=E3=83=89=E3=83=90=E3=82=A4?= =?UTF-8?q?=E3=82=B6=E3=83=BC=E4=B8=80=E8=A6=A7=E3=81=AB=E8=A1=A8=E7=A4=BA?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=82=88=E3=81=86=E3=81=AB?= =?UTF-8?q?=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/admin/users_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) 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)