Omit inactive users from board mention picker

The board-scoped mention prompt was returning all users with board access,
including those marked as inactive. This adds the `.active` scope to match
the behavior of the account-wide mention prompt.

Fixes https://app.fizzy.do/5986089/cards/3861
This commit is contained in:
Mike Dalessio
2026-02-03 18:38:39 -05:00
parent 8074bfd43e
commit e311d8f521
2 changed files with 13 additions and 1 deletions
@@ -2,7 +2,7 @@ class Prompts::Boards::UsersController < ApplicationController
include BoardScoped
def index
@users = @board.users.alphabetically
@users = @board.users.active.alphabetically
if stale? etag: @users
render layout: false
@@ -11,4 +11,16 @@ class Prompts::Boards::UsersControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_select "lexxy-prompt-item", count: 3
end
test "index excludes inactive users" do
get prompts_board_users_path(@board)
assert_response :success
assert_select "lexxy-prompt-item[search*='David']", count: 1
users(:david).update!(active: false)
get prompts_board_users_path(@board)
assert_response :success
assert_select "lexxy-prompt-item[search*='David']", count: 0
end
end