app/parsers/bulkrax/application_parser.rb in bulkrax-4.1.0 vs app/parsers/bulkrax/application_parser.rb in bulkrax-4.1.1
- old
+ new
@@ -73,10 +73,10 @@
end
def get_field_mapping_hash_for(key)
return instance_variable_get("@#{key}_hash") if instance_variable_get("@#{key}_hash").present?
- mapping = importerexporter.field_mapping == [{}] ? {} : importerexporter.field_mapping
+ mapping = importerexporter.field_mapping.is_a?(Hash) ? importerexporter.field_mapping : {}
instance_variable_set(
"@#{key}_hash",
mapping&.with_indifferent_access&.select { |_, h| h.key?(key) }
)
raise StandardError, "more than one #{key} declared: #{instance_variable_get("@#{key}_hash").keys.join(', ')}" if instance_variable_get("@#{key}_hash").length > 1