From d92aa605f23b398e4c1ac6f01b5a284802063446 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Mon, 3 Feb 2020 19:36:49 +0100 Subject: [PATCH] correct filter for person events --- app/controllers/concerns/metrics_helper.rb | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/app/controllers/concerns/metrics_helper.rb b/app/controllers/concerns/metrics_helper.rb index 54346d054..c2701a33d 100644 --- a/app/controllers/concerns/metrics_helper.rb +++ b/app/controllers/concerns/metrics_helper.rb @@ -21,18 +21,11 @@ def get_person_metrics(orcid) end def get_person_dois(orcid) - Event.query(nil, page: { size: 500 }, obj_id: https_to_http(orcid)).results.to_a.map do |e| + Event.query(nil, page: { size: 300 }, source_id: "datacite-orcid-auto-update", obj_id: "https://orcid.org/#{orcid}").results.to_a.map do |e| doi_from_url(e.subj_id) end end - def https_to_http(url) - orcid = orcid_from_url(url) - return nil if orcid.blank? - - "https://orcid.org/#{orcid}" - end - def mix_in_metrics_array(metadata_array_objects, metrics_array_hashes) return [] if metadata_array_objects.empty?