diff --git a/app/models/invenio_rdm_record_converter.rb b/app/models/invenio_rdm_record_converter.rb index 47dcf7fc..1183649a 100644 --- a/app/models/invenio_rdm_record_converter.rb +++ b/app/models/invenio_rdm_record_converter.rb @@ -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("'", "")} } : {} diff --git a/spec/models/invenio_rdm_record_converter_spec.rb b/spec/models/invenio_rdm_record_converter_spec.rb index a5b95dc7..b3461908 100644 --- a/spec/models/invenio_rdm_record_converter_spec.rb +++ b/spec/models/invenio_rdm_record_converter_spec.rb @@ -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 @@ -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",