Skip to content

Commit

Permalink
Fix import crash with empty transaction name (#783)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkottnauer authored May 20, 2024
1 parent 444155c commit 32748b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/import.rb
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def generate_transactions
csv.table.each do |row|
category = account.family.transaction_categories.find_or_initialize_by(name: row["category"])
txn = account.transactions.build \
name: row["name"] || "Imported transaction",
name: row["name"].presence || "Imported transaction",
date: Date.iso8601(row["date"]),
category: category,
amount: BigDecimal(row["amount"]) * -1, # User inputs amounts with opposite signage of our internal representation
Expand Down

0 comments on commit 32748b0

Please sign in to comment.