Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Fix credit card balance history (#2414)

Zach Gollwitzerf3ab4a27ee9a
diff --git a/app/models/plaid_account/processor.rb b/app/models/plaid_account/processor.rb
index 1a8205a1..6c999911 100644
--- a/app/models/plaid_account/processor.rb
+++ b/app/models/plaid_account/processor.rb
@@ -84,9 +84,12 @@ class PlaidAccount::Processor
if plaid_account.plaid_type == "investment"
@balance_calculator ||= PlaidAccount::Investments::BalanceCalculator.new(plaid_account, security_resolver: security_resolver)
else
+ balance = plaid_account.current_balance || plaid_account.available_balance || 0
+
+ # We don't currently distinguish "cash" vs. "non-cash" balances for non-investment accounts.
OpenStruct.new(
- balance: plaid_account.current_balance || plaid_account.available_balance,
- cash_balance: plaid_account.available_balance || 0
+ balance: balance,
+ cash_balance: balance
)
end
end