fix: instantiate RuleImport before generating rows (#1354)

* fix: instantiate RuleImport before generating rows

* test: use API keys in imports controller tests
This commit is contained in:
Tomer Horowitz
2026-04-03 02:33:11 +03:00
committed by GitHub
parent d49e74b854
commit d6183be1ae
2 changed files with 72 additions and 17 deletions

View File

@@ -52,8 +52,7 @@ class Api::V1::ImportsController < Api::V1::BaseController
type = "TransactionImport" unless Import::TYPES.include?(type)
# 2. Build the import object with permitted config attributes
@import = family.imports.build(import_config_params)
@import.type = type
@import = family.imports.build(import_config_params.merge(type: type))
@import.account_id = params[:account_id] if params[:account_id].present?
# 3. Attach the uploaded file if present (with validation)