Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Commit 46131fb

Browse files
committed
Fix unique constraint errors on sync
1 parent 49c353e commit 46131fb

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

app/models/account/syncer.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ def initialize(account, start_date: nil)
77
def run
88
holdings = sync_holdings
99
balances = sync_balances(holdings)
10+
account.reload
1011
update_account_info(balances, holdings) unless account.plaid_account_id.present?
1112
convert_foreign_records(balances)
1213
end

app/models/investment.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ def icon
2525
end
2626

2727
def post_sync
28-
broadcast_replace_to(
29-
account,
30-
target: "chart_account_#{account.id}",
31-
partial: account.plaid_account_id.present? ? "investments/chart" : "accounts/show/chart",
32-
locals: { account: account }
33-
)
28+
broadcast_refresh_to account.family
3429
end
3530
end

0 commit comments

Comments
 (0)