Class: Zizia::PreIngestWork

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/zizia/pre_ingest_work.rb

Instance Method Summary collapse

Instance Method Details

#titleString

Returns the title based on the deduplication_key if the work has been indexed to solr

Returns:

  • (String)

    the work’s title



8
9
10
11
12
13
14
# File 'app/models/zizia/pre_ingest_work.rb', line 8

def title
  return 'This work does not have a deduplication key.' if deduplication_key.nil?
  solr_title = ActiveFedora::SolrService.get("deduplication_key_tesim:#{deduplication_key}")
                                        .dig('response', 'docs', 0, 'title_tesim', 0)
  return solr_title unless solr_title.nil?
  'This work\'s metadata has not been indexed yet.'
end