1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-25 08:09:38 +02:00

Fix: Purge stale holdings from accounts during sync (#1954)

* Fix: Purge stale holdings from accounts during sync

* Fix typo

* Prevent Plaid holding deletions
This commit is contained in:
Zach Gollwitzer 2025-03-05 12:21:17 -05:00 committed by GitHub
parent eaa1b6abe0
commit 381e39bea8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 54 additions and 32 deletions

View file

@ -17,6 +17,8 @@ class Account::SyncerTest < ActiveSupport::TestCase
@account.family.update! currency: "USD"
@account.update! currency: "EUR"
@account.entries.create!(date: 1.day.ago.to_date, currency: "EUR", amount: 500, name: "Buy AAPL", entryable: Account::Trade.new(security: securities(:aapl), qty: 10, price: 50, currency: "EUR"))
ExchangeRate.create!(date: 1.day.ago.to_date, from_currency: "EUR", to_currency: "USD", rate: 1.2)
ExchangeRate.create!(date: Date.current, from_currency: "EUR", to_currency: "USD", rate: 2)