Skip to content

Commit

Permalink
Merge pull request #7714 from fjordllc/bug/add_retired_advisors_to_re…
Browse files Browse the repository at this point in the history
…tired_list

退会したアドバイザーはアドバイザー一覧に表示されないようにし、退会したユーザーを退会ユーザー一覧に表示するようにした
  • Loading branch information
komagata authored May 1, 2024
2 parents 6271fd7 + 4810d53 commit fd8aeed
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/controllers/admin/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit fd8aeed

Please sign in to comment.