Skip to content
This repository was archived by the owner on Jan 8, 2022. It is now read-only.

[HOLD] Migration ( DO NOT USE) #507

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Export contributors
jcoyne committed May 27, 2021
commit 6ed567b9a7000f1f84ddd952fbff72e788be3660
6 changes: 5 additions & 1 deletion bin/export-items
Original file line number Diff line number Diff line change
@@ -10,6 +10,9 @@ list = Hydrus::Item.all
def serialize(item)
creator = item.roleMetadata.ng_xml.xpath('//role/person/identifier').text
related_items = item.related_items.map { |rel| { link_title: rel.title.presence, url: rel.url.presence }.compact }.reject(&:blank?)
contributors = item.contributors.
map { |contrib| { full_name: contrib.name, role: contrib.role, name_type: contrib.name_type }}.
reject { |contrib| contrib[:full_name].blank? }

{
druid: item.id,
@@ -26,7 +29,8 @@ def serialize(item)
object_status: item.object_status,
item_type: item.item_type,
citation: item.preferred_citation,
related_items: related_items
related_items: related_items,
contributors: contributors
}
end