mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-03 04:25:21 +02:00
Fix import crash with empty transaction name (#783)
This commit is contained in:
parent
444155c103
commit
32748b0632
1 changed files with 1 additions and 1 deletions
|
@ -112,7 +112,7 @@ class Import < ApplicationRecord
|
|||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue