From 8bc5e15f8233767333aaef6448c57fcb815626c9 Mon Sep 17 00:00:00 2001 From: kjgarza Date: Tue, 31 Dec 2019 18:06:00 +0100 Subject: [PATCH] transform to array to string --- app/graphql/types/person_type.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/graphql/types/person_type.rb b/app/graphql/types/person_type.rb index 749f5399e..5cdc7d728 100644 --- a/app/graphql/types/person_type.rb +++ b/app/graphql/types/person_type.rb @@ -54,21 +54,21 @@ def citation_count(**_args) dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e| doi_from_url(e.subj_id) end - EventsQuery.new.citations(dois).sum { |h| h[:count] } + EventsQuery.new.citations(dois.join(",")).sum { |h| h[:count] } end def view_count(**_args) dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e| doi_from_url(e.subj_id) end - EventsQuery.new.views(dois).sum { |h| h[:count] } + EventsQuery.new.views(dois.join(",")).sum { |h| h[:count] } end def download_count(**_args) dois = Event.query(nil, obj_id: https_to_http(object[:id])).results.to_a.map do |e| doi_from_url(e.subj_id) end - EventsQuery.new.downloads(dois).sum { |h| h[:count] } + EventsQuery.new.downloads(dois.join(",")).sum { |h| h[:count] } end def https_to_http(url)