mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-04 21:15:19 +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|
|
csv.table.each do |row|
|
||||||
category = account.family.transaction_categories.find_or_initialize_by(name: row["category"])
|
category = account.family.transaction_categories.find_or_initialize_by(name: row["category"])
|
||||||
txn = account.transactions.build \
|
txn = account.transactions.build \
|
||||||
name: row["name"] || "Imported transaction",
|
name: row["name"].presence || "Imported transaction",
|
||||||
date: Date.iso8601(row["date"]),
|
date: Date.iso8601(row["date"]),
|
||||||
category: category,
|
category: category,
|
||||||
amount: BigDecimal(row["amount"]) * -1, # User inputs amounts with opposite signage of our internal representation
|
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