Skip to content

Commit 5ea4ad1

Browse files
Merge pull request #1610 from projectblacklight/1609-unitid
Pass collection unitid to NoramlizedId for local use
2 parents 8274ec8 + 33f0e6b commit 5ea4ad1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lib/arclight/traject/ead2_config.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@
7979

8080
to_field 'id' do |record, accumulator|
8181
id = record.at_xpath('/ead/eadheader/eadid')&.text
82+
unitid = record.at_xpath('/ead/archdesc/did/unitid')&.text
8283
title = record.at_xpath('/ead/archdesc/did/unittitle')&.text
8384
repository = settings['repository']
84-
accumulator << settings['id_normalizer'].constantize.new(id, title: title, repository: repository).to_s
85+
accumulator << settings['id_normalizer'].constantize.new(id, unitid: unitid, title: title, repository: repository).to_s
8586
end
8687

8788
to_field 'title_filing_ssi', extract_xpath('/ead/eadheader/filedesc/titlestmt/titleproper[@type="filing"]')

spec/lib/arclight/normalized_id_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
end
3434

3535
context 'when additional keyword arguments are supplied' do
36-
subject(:normalized_id) { described_class.new('abc123.xml', title: 'a title', repository: 'repo').to_s }
36+
subject(:normalized_id) do
37+
described_class.new('abc123.xml', unitid: 'abc-123', title: 'a title', repository: 'repo').to_s
38+
end
3739

3840
it 'accepts the additional arguments without changing the output' do
3941
expect(normalized_id).to eq 'abc123-xml'

0 commit comments

Comments
 (0)