Sha256: aa8e617954d42056f3f1bdf3855c860f9ef99f4b120ac34b2d5922a80b426bce

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

# frozen_string_literal: true

module Bulkrax
  class CsvCollectionEntry < CsvEntry
    def factory_class
      Collection
    end

    # Use identifier set by CsvParser#unique_collection_identifier, which falls back
    # on the Collection's first title if record[source_identifier] is not present
    def add_identifier
      self.parsed_metadata[work_identifier] = [self.identifier].flatten
    end

    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.to_global_id.to_s
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bulkrax-5.5.1 app/models/bulkrax/csv_collection_entry.rb
bulkrax-6.0.1 app/models/bulkrax/csv_collection_entry.rb
bulkrax-6.0.0 app/models/bulkrax/csv_collection_entry.rb
bulkrax-5.5.0 app/models/bulkrax/csv_collection_entry.rb