Account-level import configuration templates (#1946)

* Account-level import configuration templates

* Default import to family's preferred date format
This commit is contained in:
Zach Gollwitzer
2025-03-04 13:10:01 -05:00
committed by GitHub
parent 5b2fa3d707
commit 0544089710
15 changed files with 108 additions and 43 deletions

View File

@@ -30,11 +30,10 @@ class Import::Row < ApplicationRecord
end
end
def sync_mappings
Import::CategoryMapping.sync(import) if import.column_keys.include?(:category)
Import::TagMapping.sync(import) if import.column_keys.include?(:tags)
Import::AccountMapping.sync(import) if import.column_keys.include?(:account)
Import::AccountTypeMapping.sync(import) if import.column_keys.include?(:entity_type)
def update_and_sync(params)
assign_attributes(params)
save!(validate: false)
import.sync_mappings
end
private