Skip to content

Commit

Permalink
Merge pull request #823 from galterlibrary/793-export_metadata_subfie…
Browse files Browse the repository at this point in the history
…lds_description_and_additional_descriptions

[#793] Export Metadata Subfields Description And Additional Descriptions
  • Loading branch information
Meowcenary authored Feb 4, 2021
2 parents 4692bb8 + 0441de3 commit a7d71dd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/models/invenio_rdm_record_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def invenio_metadata(gf)
"creators": creators(gf.creator),
"title": gf.title.first,
"additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} },
"description": gf.description.first,
"additional_descriptions": gf.description.last(gf.description.size-1).map{ |add_desc| {"description": add_desc, "type": "other", "lang": "eng"} },
"subjects": SUBJECT_SCHEMES.map{ |subject_type| subjects_for_scheme(gf.send(subject_type), subject_type) }.flatten,
"formats": gf.mime_type,
"locations": gf.based_near.present? ? gf.based_near.shift.split("', ").map{ |location| {place: location.gsub("'", "")} } : {}
Expand Down
5 changes: 4 additions & 1 deletion spec/models/invenio_rdm_record_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
mesh: [mesh_term],
lcsh: [lcsh_term],
mime_type: 'application/pdf',
based_near: ["'Boston, Massachusetts, United States', 'East Peoria, Illinois, United States'"]
based_near: ["'Boston, Massachusetts, United States', 'East Peoria, Illinois, United States'"],
description: ["This is a generic file for specs only", "This is an additional description to help test"]
)
}
let(:json) do
Expand Down Expand Up @@ -58,6 +59,8 @@
"lang": "eng"
}
],
"description": generic_file.description.shift,
"additional_descriptions": [{"description": generic_file.description.last, "type": "other", "lang": "eng"}],
"subjects": [
{
"subject": "keyword subject",
Expand Down

0 comments on commit a7d71dd

Please sign in to comment.