From 372b64ffea651bfdede2a990876d102b53e5ba38 Mon Sep 17 00:00:00 2001 From: Zach Gollwitzer Date: Wed, 5 Mar 2025 16:02:07 -0500 Subject: [PATCH] Fix Plaid sync error when current balance is null --- app/models/plaid_account.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/plaid_account.rb b/app/models/plaid_account.rb index 186105ce..77a4288d 100644 --- a/app/models/plaid_account.rb +++ b/app/models/plaid_account.rb @@ -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 )