From e1361bee7ba74bc5eacde55a2e7eb92a8106100b Mon Sep 17 00:00:00 2001 From: Benjamin Kiah Stroud <32469930+bkiahstroud@users.noreply.github.com> Date: Fri, 28 Jun 2024 21:14:26 -0700 Subject: [PATCH] fall back on default work type when model is empty --- app/parsers/bulkrax/csv_parser_decorator.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/parsers/bulkrax/csv_parser_decorator.rb b/app/parsers/bulkrax/csv_parser_decorator.rb index 415b4c588..a75378fb3 100644 --- a/app/parsers/bulkrax/csv_parser_decorator.rb +++ b/app/parsers/bulkrax/csv_parser_decorator.rb @@ -23,7 +23,8 @@ def valid_import? private def missing_fields_for(record) - required_fields = determine_required_fields_for(record[:model]) + model = record[:model] || Bulkrax.default_work_type + required_fields = determine_required_fields_for(model) required_fields.select do |field| # checks the field itself # any parser_mappings fields terms from `config/initializers/bulkrax.rb`