From b84c03071d77db73ee9c623b22a87c676150dd5b Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Mon, 8 Apr 2019 18:34:03 +0200 Subject: [PATCH] remove duplicated code --- app/models/doi.rb | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/app/models/doi.rb b/app/models/doi.rb index 537a20dd0..b5f7565f1 100644 --- a/app/models/doi.rb +++ b/app/models/doi.rb @@ -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,