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

Commit 015aaa3

Browse files
committed
Export contributors
1 parent 202cdf2 commit 015aaa3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/export-items

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ list = Hydrus::Item.all
1010
def serialize(item)
1111
creator = item.roleMetadata.ng_xml.xpath('//role/person/identifier').text
1212
related_items = item.related_items.map { |rel| { link_title: rel.title.presence, url: rel.url.presence }.compact }.reject(&:blank?)
13+
contributors = item.contributors.
14+
map { |contrib| { full_name: contrib.name, role: contrib.role, name_type: contrib.name_type }}.
15+
reject { |contrib| contrib[:full_name].blank? }
1316

1417
{
1518
druid: item.id,
@@ -26,7 +29,8 @@ def serialize(item)
2629
object_status: item.object_status,
2730
item_type: item.item_type,
2831
citation: item.preferred_citation,
29-
related_items: related_items
32+
related_items: related_items,
33+
contributors: contributors
3034
}
3135
end
3236

0 commit comments

Comments
 (0)