3ef5e4eeef
Before, we were relying on just changing the cards_count in account, but this could create problems where the system to calculate the next card number fails due to the unique constraint.
13 lines
246 B
Ruby
13 lines
246 B
Ruby
module Admin::AccountScoped
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
before_action :set_account
|
|
end
|
|
|
|
private
|
|
def set_account
|
|
@account = Account.find_by!(external_account_id: params[:account_id] || params[:id])
|
|
end
|
|
end
|