mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-28 01:29:39 +02:00
Fix unique constraint errors on sync
This commit is contained in:
parent
49c353e10c
commit
46131fb496
2 changed files with 2 additions and 6 deletions
|
@ -7,6 +7,7 @@ class Account::Syncer
|
||||||
def run
|
def run
|
||||||
holdings = sync_holdings
|
holdings = sync_holdings
|
||||||
balances = sync_balances(holdings)
|
balances = sync_balances(holdings)
|
||||||
|
account.reload
|
||||||
update_account_info(balances, holdings) unless account.plaid_account_id.present?
|
update_account_info(balances, holdings) unless account.plaid_account_id.present?
|
||||||
convert_foreign_records(balances)
|
convert_foreign_records(balances)
|
||||||
end
|
end
|
||||||
|
|
|
@ -25,11 +25,6 @@ class Investment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def post_sync
|
def post_sync
|
||||||
broadcast_replace_to(
|
broadcast_refresh_to account.family
|
||||||
account,
|
|
||||||
target: "chart_account_#{account.id}",
|
|
||||||
partial: account.plaid_account_id.present? ? "investments/chart" : "accounts/show/chart",
|
|
||||||
locals: { account: account }
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue