Sha256: 60d273b446b17fcf42aa75cb0337836644b11814da0c57ee3e57750210673299

Contents?: true

Size: 674 Bytes

Versions: 10

Compression:

Stored size: 674 Bytes

Contents

# frozen_string_literal: true

module Bulkrax
  class CsvCollectionEntry < CsvEntry
    self.default_work_type = Bulkrax.collection_model_class.to_s

    # 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

10 entries across 10 versions & 1 rubygems

Version Path
bulkrax-9.0.2 app/models/bulkrax/csv_collection_entry.rb
bulkrax-9.0.1 app/models/bulkrax/csv_collection_entry.rb
bulkrax-9.0.0 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.2.3 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.2.2 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.3.0 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.2.1 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.2.0 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.1.0 app/models/bulkrax/csv_collection_entry.rb
bulkrax-8.0.0 app/models/bulkrax/csv_collection_entry.rb