Skip to content

Commit

Permalink
[#801] Export Metadata Subfield Formats
Browse files Browse the repository at this point in the history
closes #801
  • Loading branch information
Meowcenary committed Jan 21, 2021
1 parent 32dfdd6 commit 570d863
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion app/models/invenio_rdm_record_converter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 4 additions & 2 deletions spec/models/invenio_rdm_record_converter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -50,7 +51,8 @@
"title": "Tertiary Title",
"type": "alternative_title",
"lang": "eng"
}]
}],
"formats": "application/pdf"
},
"provenance": {
"created_by": {
Expand Down

0 comments on commit 570d863

Please sign in to comment.