The personal finance app for everyone
Fix unique constraint errors on sync
Zach Gollwitzer46131fb496f9
diff --git a/app/models/account/syncer.rb b/app/models/account/syncer.rbindex 43ac980e..61a4ef99 100644--- a/app/models/account/syncer.rb+++ b/app/models/account/syncer.rb@@ -7,6 +7,7 @@ class Account::Syncerdef runholdings = sync_holdingsbalances = sync_balances(holdings)+ account.reloadupdate_account_info(balances, holdings) unless account.plaid_account_id.present?convert_foreign_records(balances)enddiff --git a/app/models/investment.rb b/app/models/investment.rbindex 29148f06..6f6c1e57 100644--- a/app/models/investment.rb+++ b/app/models/investment.rb@@ -25,11 +25,6 @@ class Investment < ApplicationRecordenddef 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.familyendend