Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ignore-misidentified-collection-entries #600

Merged
merged 1 commit into from
Jul 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/parsers/bulkrax/csv_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def retrieve_cloud_files(files)
def write_files
require 'open-uri'
folder_count = 0
sorted_entries = sort_entries(importerexporter.entries)
sorted_entries = sort_entries(importerexporter.entries.uniq(&:identifier))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

before #597, child collections were exported as a CsvEntry class instead of CsvCollectionEntry. this means that when that importer/exporter is run again, the old entry still exists, but a new one is created as well. we want to get the newest one.

irb(main):148:0> current_record_ids.count
=> 13

irb(main):149:0> Bulkrax::Exporter.find(59).entries.count
=> 14

Bulkrax::Exporter.find(59).entries.uniq(&:identifier).count
=> 13


sorted_entries[0..limit || total].in_groups_of(records_split_count, false) do |group|
folder_count += 1
Expand Down