Skip to content

Commit

Permalink
Fix unique constraint errors on sync
Browse files Browse the repository at this point in the history
  • Loading branch information
zachgoll committed Dec 10, 2024
1 parent 49c353e commit 46131fb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/models/account/syncer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ def initialize(account, start_date: nil)
def run
holdings = sync_holdings
balances = sync_balances(holdings)
account.reload
update_account_info(balances, holdings) unless account.plaid_account_id.present?
convert_foreign_records(balances)
end
Expand Down
7 changes: 1 addition & 6 deletions app/models/investment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ def icon
end

def post_sync
broadcast_replace_to(
account,
target: "chart_account_#{account.id}",
partial: account.plaid_account_id.present? ? "investments/chart" : "accounts/show/chart",
locals: { account: account }
)
broadcast_refresh_to account.family
end
end

0 comments on commit 46131fb

Please sign in to comment.