mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 05:09:38 +02:00
Fix Plaid sync error when current balance is null
This commit is contained in:
parent
9627a6bf6f
commit
372b64ffea
1 changed files with 1 additions and 1 deletions
|
@ -20,7 +20,7 @@ class PlaidAccount < ApplicationRecord
|
|||
find_or_create_by!(plaid_id: plaid_data.account_id) do |a|
|
||||
a.account = family.accounts.new(
|
||||
name: plaid_data.name,
|
||||
balance: plaid_data.balances.current,
|
||||
balance: plaid_data.balances.current || plaid_data.balances.available,
|
||||
currency: plaid_data.balances.iso_currency_code,
|
||||
accountable: TYPE_MAPPING[plaid_data.type].new
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue