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

use the GlobalID library tooling to determine global id #869

Merged
merged 1 commit into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
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/factories/bulkrax/object_factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def clean_attrs(attrs)
def collection_type(attrs)
return attrs if attrs['collection_type_gid'].present?

attrs['collection_type_gid'] = Hyrax::CollectionType.find_or_create_default_collection_type.gid
attrs['collection_type_gid'] = Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id.to_s
attrs
end

Expand Down
2 changes: 1 addition & 1 deletion app/models/bulkrax/csv_collection_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def add_identifier
def add_collection_type_gid
return if self.parsed_metadata['collection_type_gid'].present?

self.parsed_metadata['collection_type_gid'] = ::Hyrax::CollectionType.find_or_create_default_collection_type.gid
self.parsed_metadata['collection_type_gid'] = ::Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id.to_s
end
end
end
2 changes: 1 addition & 1 deletion app/parsers/bulkrax/oai_dc_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def create_collections
metadata = {
visibility: 'open'
}
metadata[:collection_type_gid] = Hyrax::CollectionType.find_or_create_default_collection_type.gid if defined?(::Hyrax)
metadata[:collection_type_gid] = Hyrax::CollectionType.find_or_create_default_collection_type.to_global_id.to_s if defined?(::Hyrax)

collections.each_with_index do |set, index|
next unless collection_name == 'all' || collection_name == set.spec
Expand Down