Skip to content

Commit

Permalink
don't allow doi as alternate identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Jul 13, 2020
1 parent 5c57c15 commit d40e8b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bolognese (1.7.2)
bolognese (1.7.3)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down
5 changes: 3 additions & 2 deletions lib/bolognese/datacite_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,11 @@ def insert_resource_type(xml)
end

def insert_alternate_identifiers(xml)
return xml unless identifiers.present?
alternate_identifiers = Array.wrap(identifiers).select { |r| r["identifierType"] != "DOI" }
return xml unless alternate_identifiers.present?

xml.alternateIdentifiers do
Array.wrap(identifiers).each do |alternate_identifier|
Array.wrap(alternate_identifiers).each do |alternate_identifier|
xml.alternateIdentifier(alternate_identifier["identifier"], 'alternateIdentifierType' => alternate_identifier["identifierType"])
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bolognese/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Bolognese
VERSION = "1.7.2"
VERSION = "1.7.3"
end

0 comments on commit d40e8b7

Please sign in to comment.