1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-05 21:45:23 +02:00

Fix import configuration failures (#1876)

This commit is contained in:
Zach Gollwitzer 2025-02-21 08:58:06 -05:00 committed by GitHub
parent c620d1fc1e
commit 8539ac7dec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 4 deletions

View file

@ -105,8 +105,8 @@ class Import < ApplicationRecord
def generate_rows_from_csv
rows.destroy_all
csv_rows.each do |row|
rows.create!(
mapped_rows = csv_rows.map do |row|
{
account: row[account_col_label].to_s,
date: row[date_col_label].to_s,
qty: sanitize_number(row[qty_col_label]).to_s,
@ -119,8 +119,10 @@ class Import < ApplicationRecord
tags: row[tags_col_label].to_s,
entity_type: row[entity_type_col_label].to_s,
notes: row[notes_col_label].to_s
)
}
end
rows.insert_all!(mapped_rows)
end
def sync_mappings