Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/datacite/lupo
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Oct 4, 2020
2 parents 4a1c40b + 7a7485a commit f6adbbc
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2325,9 +2325,25 @@ def self.add_index_type(options={})

Doi.where(id: from_id..until_id).where('type' => nil).find_each(batch_size: 500) do |doi|
begin
if doi.agency.casecmp?("datacite")
agency = doi.agency

if agency.blank? || agency.casecmp?("datacite")
type = "DataciteDoi"
elsif doi.agency.casecmp?("crossref")
elsif agency.casecmp?("crossref")
type = "OtherDoi"
elsif agency.casecmp?("kisti")
type = "OtherDoi"
elsif agency.casecmp?("medra")
type = "OtherDoi"
elsif agency.casecmp?("istic")
type = "OtherDoi"
elsif agency.casecmp?("jalc")
type = "OtherDoi"
elsif agency.casecmp?("airiti")
type = "OtherDoi"
elsif agency.casecmp?("cnki")
type = "OtherDoi"
elsif agency.casecmp?("op")
type = "OtherDoi"
else
type = "DataciteDoi"
Expand Down

0 comments on commit f6adbbc

Please sign in to comment.