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.
This commit was merged in pull request #918.
This commit is contained in:
Igor Carvalho
2024-06-24 11:31:21 -03:00
committed by GitHub
parent a5212f0f5e
commit 094128fef1

View File

@@ -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:)