From 094128fef13dc33bf483d4eab060e89304646523 Mon Sep 17 00:00:00 2001 From: Igor Carvalho <43913738+igorcarvalhh@users.noreply.github.com> Date: Mon, 24 Jun 2024 11:31:21 -0300 Subject: [PATCH] Fix issue #861: Correct header selection logic in get_selected_header_for_field method (#918) The get_selected_header_for_field method was incorrectly using the entire field object instead of the field key to dig into the column_mappings hash. This caused an error when trying to retrieve the selected header for a field. --- app/models/import.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/import.rb b/app/models/import.rb index 49fc4f96..ef4e3675 100644 --- a/app/models/import.rb +++ b/app/models/import.rb @@ -38,7 +38,7 @@ class Import < ApplicationRecord end def get_selected_header_for_field(field) - column_mappings&.dig(field) || field.key + column_mappings&.dig(field.key) || field.key end def update_csv!(row_idx:, col_idx:, value:)