From b2960626487168c3c51b0f08c3ba8389877813f9 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Sun, 25 Aug 2019 14:42:13 +0200 Subject: [PATCH] cumulate researcher doi counts --- app/controllers/concerns/countable.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/countable.rb b/app/controllers/concerns/countable.rb index 00e26d9db..39bcfdb79 100644 --- a/app/controllers/concerns/countable.rb +++ b/app/controllers/concerns/countable.rb @@ -15,7 +15,11 @@ def doi_count(client_id: nil, provider_id: nil, consortium_id: nil, researcher_i response = Doi.query(nil, page: { number: 1, size: 0 }) end - response.results.total > 0 ? facet_by_year(response.response.aggregations.created.buckets) : [] + if researcher_id + response.results.total > 0 ? facet_by_cumulative_year(response.response.aggregations.created.buckets) : [] + else + response.results.total > 0 ? facet_by_year(response.response.aggregations.created.buckets) : [] + end end # cumulative count clients by year