Skip to content

Commit 6e19745

Browse files
committed
fix missing update balance on 1 time installment
1 parent 2bf82a1 commit 6e19745

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

app/controllers/transactions_controller.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def create
2222

2323
if @transaction.valid?
2424
Transaction.create_with_installments(@transaction, installments)
25+
@transaction.account.update_balance
2526

2627
redirect_to account_url(@transaction.account), notice: "Transaction was successfully created."
2728
else

app/models/transaction/installmentable.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ def create_multiple_installments(original_transaction, installments_count)
4242
end
4343
end
4444

45-
# Return the first transaction
46-
transactions.first.account.update_balance
4745
transactions.first
4846
end
4947

0 commit comments

Comments
 (0)