Skip to content

Commit

Permalink
remove duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 8, 2019
1 parent d7cabfc commit b84c030
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions app/models/doi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -711,18 +711,8 @@ def media_ids
media.pluck(:id).map { |m| Base32::URL.encode(m, split: 4, length: 16) }.compact
end


def self.normalize_doi(doi)
doi = Array(/\A(?:(http|https):\/(\/)?(dx\.)?(doi.org|handle.test.datacite.org)\/)?(doi:)?(10\.\d{4,5}\/.+)\z/.match(doi)).last
doi = doi.delete("\u200B").downcase if doi.present?
"https://doi.org/#{doi}" if doi.present?
end

def self.find_by_ids(ids, options={})
dois = ids.split(",").map(&:upcase)


puts dois

__elasticsearch__.search({
from: 0,
Expand Down

0 comments on commit b84c030

Please sign in to comment.