mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-22 22:59:39 +02:00
Make balance editing easier (#976)
* Make balance editing easier * Translations * Fix money input option * Fix balance sync logic * Rework balance update flow
This commit is contained in:
parent
b002a41b35
commit
34e03c2d6a
9 changed files with 91 additions and 23 deletions
|
@ -40,7 +40,9 @@ class AccountsController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
@account.update! account_params.except(:accountable_type)
|
||||
@account.update! account_params.except(:accountable_type, :balance)
|
||||
@account.update_balance!(account_params[:balance]) if account_params[:balance]
|
||||
@account.sync_later
|
||||
redirect_back_or_to account_path(@account), notice: t(".success")
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue