Files
once-campfire/app/controllers/accounts_controller.rb
T
Marcello Costagliola ce4c05da81 Apply the same user filter to every page of account members
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
2026-10-05 15:19:21 +02:00

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