Add at least one BankAccount to the reference_calculator

This commit is contained in:
Patrick Gansterer 2020-08-01 17:37:43 +02:00
parent d52315287d
commit 5f2e319469

View file

@ -18,6 +18,7 @@ class HomeController < ApplicationController
if current_user.ordergroup
@types = FinancialTransactionType.with_name_short.order(:name)
@bank_accounts = @types.includes(:bank_account).map(&:bank_account).uniq.compact
@bank_accounts = [BankAccount.last] if @bank_accounts.empty?
else
redirect_to root_url, alert: I18n.t('group_orders.errors.no_member')
end