mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-10-08 07:40:08 +09:00
ce4c05da81
Administrators see banned users in the account settings, but only the first page counted them: the next pages listed active users alone. A banned member before the page boundary shifted the offset, so one active member was never listed. Both pages now share User.visible_to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0142qgjggdJ2KDdGk7RF9Xm9
25 lines
587 B
Ruby
25 lines
587 B
Ruby
class AccountsController < ApplicationController
|
|
before_action :ensure_can_administer, only: :update
|
|
before_action :set_account
|
|
|
|
def edit
|
|
users = User.visible_to(Current.user).ordered
|
|
@administrators = users.administrator
|
|
set_page_and_extract_portion_from users.member, per_page: 500
|
|
end
|
|
|
|
def update
|
|
@account.update!(account_params)
|
|
redirect_to edit_account_url, notice: "✓"
|
|
end
|
|
|
|
private
|
|
def set_account
|
|
@account = Current.account
|
|
end
|
|
|
|
def account_params
|
|
params.require(:account).permit(:name, :logo, settings: {})
|
|
end
|
|
end
|