Skip to content

Commit

Permalink
Merge pull request #399 from samvera-labs/stop-sorting-records-on-csv…
Browse files Browse the repository at this point in the history
…-entry

do not sort the records before mapping the metadata
  • Loading branch information
alishaevn authored Jan 27, 2022
2 parents f76b0bf + 6f16743 commit 5189672
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/bulkrax/csv_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ def add_ingested_metadata
'Creating Collections using the collection_field_mapping will no longer be supported as of Bulkrax version 3.0.' \
' Please configure Bulkrax to use related_parents_field_mapping and related_children_field_mapping instead.'
)
record.sort.each do |key, value|
# we do not want to sort the values in the record before adding the metadata.
# if we do, the factory_class will be set to the default_work_type for all values that come before "model" or "work type"
record.each do |key, value|
next if self.parser.collection_field_mapping.to_s == key_without_numbers(key)

index = key[/\d+/].to_i - 1 if key[/\d+/].to_i != 0
Expand Down

0 comments on commit 5189672

Please sign in to comment.