Skip to content

Commit

Permalink
🐛 Bring over CsvParserDecorator fix from Pals
Browse files Browse the repository at this point in the history
  • Loading branch information
kirkkwang committed Jun 20, 2024
1 parent 4a0c400 commit 9564a32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/parsers/bulkrax/csv_parser_decorator.rb
Original file line number Diff line number Diff line change
@@ -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?
Expand All @@ -16,7 +17,7 @@ def valid_import?

file_paths.is_a?(Array)
rescue StandardError => e
status_info(e)
set_status_info(e)
false
end

Expand Down

0 comments on commit 9564a32

Please sign in to comment.