mirror of
https://github.com/we-promise/sure.git
synced 2026-04-19 03:54:08 +00:00
Remove plaid initialiser (#317)
* Remove plaid initialiser The initializer can be safely removed because: - Config is lazily loaded via Provider::Registry - reload_configuration is called after settings updates - All calling code handles nil configs gracefully - Initial nil state is fine - config loads on first use * Fix for missing config * Actually don't pollute application.rb * Add currency loading for balances * Fix race condition on lazy load * Allow loans to be imported in lunch flow also * Fix currency processor
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
require "digest/md5"
|
||||
|
||||
class SimplefinEntry::Processor
|
||||
include CurrencyNormalizable
|
||||
# simplefin_transaction is the raw hash fetched from SimpleFin API and converted to JSONB
|
||||
def initialize(simplefin_transaction, simplefin_account:)
|
||||
@simplefin_transaction = simplefin_transaction
|
||||
@@ -77,7 +78,11 @@ class SimplefinEntry::Processor
|
||||
end
|
||||
|
||||
def currency
|
||||
data[:currency] || account.currency
|
||||
parse_currency(data[:currency]) || account.currency
|
||||
end
|
||||
|
||||
def log_invalid_currency(currency_value)
|
||||
Rails.logger.warn("Invalid currency code '#{currency_value}' in SimpleFIN transaction #{external_id}, falling back to account currency")
|
||||
end
|
||||
|
||||
def date
|
||||
|
||||
Reference in New Issue
Block a user