diff --git a/app/models/invenio_rdm_record_converter.rb b/app/models/invenio_rdm_record_converter.rb index c9792ad2..4ae2f659 100644 --- a/app/models/invenio_rdm_record_converter.rb +++ b/app/models/invenio_rdm_record_converter.rb @@ -79,7 +79,8 @@ def invenio_metadata(gf) "resource_type": resource_type(gf.resource_type.shift), "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"} } + "additional_titles": gf.title.last(gf.title.size-1).map{ |title| {"title": title, "type": "alternative_title", "lang": "eng"} }, + "formats": gf.mime_type } end @@ -137,9 +138,4 @@ def creators(creators) } end end - - def format_creator_names(creator_name) - family_name = creator_name.pop # remove last value from display name - given_name = creator_name.join(' ') # the remaining strings becomes given name - end end diff --git a/spec/models/invenio_rdm_record_converter_spec.rb b/spec/models/invenio_rdm_record_converter_spec.rb index 646de201..416254bf 100644 --- a/spec/models/invenio_rdm_record_converter_spec.rb +++ b/spec/models/invenio_rdm_record_converter_spec.rb @@ -12,7 +12,8 @@ proxy_depositor: assistant.username, on_behalf_of: user.username, creator: [user.formal_name], - title: ["Primary Title"] + title: ["Primary Title"], + mime_type: 'application/pdf' ) } let(:json) do @@ -50,7 +51,8 @@ "title": "Tertiary Title", "type": "alternative_title", "lang": "eng" - }] + }], + "formats": "application/pdf" }, "provenance": { "created_by": {