mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 12:04:08 +00:00
Fix Broken Account Re-linking Feature (#469)
* Update SimpleFIN relinking flow and enhance duplicate account handling - Updated logic to allow relinking of SimpleFIN accounts while preserving legacy mappings. - Introduced clean-up logic to hide orphaned duplicate accounts after relinking. - Enhanced UI to display current mappings for linked accounts. - Improved test coverage for relinking scenarios and SimpleFIN account visibility. * Localize SimpleFIN account selection messages and remove hardcoded text - Added translations for user-facing messages in `select_existing_account` flow (`pt-BR` and `en` locales). - Replaced hardcoded strings in the view with localized keys. * Localize Enable Banking and SimpleFIN account linking messages; add support for investment accounts. - Added translations for Enable Banking and SimpleFIN account linking flows. - Updated views and controllers to replace hardcoded strings with localized keys. - Introduced support for investment accounts in `Provider::LunchflowAdapter`. - Enhanced relinking logic for SimpleFIN accounts and improved test coverage for related scenarios. --------- Co-authored-by: Josh Waldrep <joshua.waldrep5+github@gmail.com>
This commit is contained in:
@@ -39,8 +39,10 @@ module SimplefinItem::Unlinking
|
||||
end
|
||||
|
||||
# Legacy FK fallback: ensure any legacy link is cleared
|
||||
if sfa.account_id.present?
|
||||
sfa.update!(account: nil)
|
||||
# NOTE: `SimplefinAccount#account_id` is the provider's external identifier.
|
||||
# The legacy link is `Account.simplefin_account_id` (accessible via `sfa.account`).
|
||||
if sfa.account.present?
|
||||
sfa.account.update!(simplefin_account_id: nil)
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
|
||||
Reference in New Issue
Block a user