From 9564a322c2c84f264e5b0b8ade05602910b54e41 Mon Sep 17 00:00:00 2001 From: Kirk Wang Date: Thu, 20 Jun 2024 09:38:46 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Bring=20over=20CsvParserDecorato?= =?UTF-8?q?r=20fix=20from=20Pals?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ref: - https://github.com/scientist-softserv/palni_palci_knapsack/commit/9549183db75c2ad10665ee59799ab73e5647b7fd --- app/parsers/bulkrax/csv_parser_decorator.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/parsers/bulkrax/csv_parser_decorator.rb b/app/parsers/bulkrax/csv_parser_decorator.rb index 9563eda47..6a2b57822 100644 --- a/app/parsers/bulkrax/csv_parser_decorator.rb +++ b/app/parsers/bulkrax/csv_parser_decorator.rb @@ -1,12 +1,13 @@ # frozen_string_literal: true -# OVERRIDE BULKRAX 5.3.0 to include oer specific methods and model level required fields checking +# OVERRIDE BULKRAX 8.1.0 to include oer specific methods and model level required fields checking module Bulkrax module CsvParserDecorator include OerCsvParser def valid_import? missing_fields_by_model = records.each_with_object({}) do |record, hash| + record.compact! record.transform_keys!(&:downcase).transform_keys!(&:to_sym) missing_fields = missing_fields_for(record) hash[record[:model]] = missing_fields if missing_fields.present? @@ -16,7 +17,7 @@ def valid_import? file_paths.is_a?(Array) rescue StandardError => e - status_info(e) + set_status_info(e) false end