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

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 is contained in:
Igor Carvalho 2024-06-24 11:31:21 -03:00 committed by GitHub
parent a5212f0f5e
commit 094128fef1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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