mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-31 11:09:39 +02:00
Add auto-update strategies for current balance on manual accounts (#2460)
* Add auto-update strategies for current balance on manual accounts * Remove deprecated BalanceUpdater, replace with new methods
This commit is contained in:
parent
52333e3fa6
commit
3eea5a9891
13 changed files with 311 additions and 136 deletions
|
@ -37,10 +37,10 @@ class PropertiesController < ApplicationController
|
|||
end
|
||||
|
||||
def update_balances
|
||||
result = @account.update_balance(balance: balance_params[:balance], currency: balance_params[:currency])
|
||||
result = @account.set_current_balance(balance_params[:balance].to_d)
|
||||
|
||||
if result.success?
|
||||
@success_message = result.updated? ? "Balance updated successfully." : "No changes made. Account is already up to date."
|
||||
@success_message = "Balance updated successfully."
|
||||
|
||||
if @account.active?
|
||||
render :balances
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue