diff --git a/.gitignore b/.gitignore index 6618bc20..eeb5e8f2 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,4 @@ node_modules compose.yml -plaid_test_accounts/ -dump.rdb -dev.docs.md \ No newline at end of file +plaid_test_accounts/ \ No newline at end of file diff --git a/app/models/simple_fin_account.rb b/app/models/simple_fin_account.rb index 7907d162..15e51fc7 100644 --- a/app/models/simple_fin_account.rb +++ b/app/models/simple_fin_account.rb @@ -174,8 +174,11 @@ class SimpleFinAccount < ApplicationRecord amount_from_sf = transaction_data["amount"].to_d * -1 # account_type = self.account.accountable_type + # Try to determine name from best option + name = transaction_data["description"].presence || "Transaction" + entry.assign_attributes( - name: transaction_data["description"], + name: name, amount: amount_from_sf, currency: self.account.currency, date: Time.at(transaction_data["posted"].to_i).to_date,