From 9e9e2fa1e87799e38d3554f4b3006eeda31cac8b Mon Sep 17 00:00:00 2001 From: Cameron Roudebush Date: Sat, 17 May 2025 14:08:34 -0400 Subject: [PATCH] chore: Cleanup for PR - Cleanup gitignore - Fix transaction naming bug --- .gitignore | 4 +--- app/models/simple_fin_account.rb | 5 ++++- 2 files changed, 5 insertions(+), 4 deletions(-) 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,