From 63bd21c8766115b77483e27c92e7fccf375647f1 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 9 Oct 2020 10:58:42 +0200 Subject: [PATCH] remove crossref dois from stats portal. #53 --- app/controllers/concerns/facetable.rb | 2 +- spec/requests/providers_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/facetable.rb b/app/controllers/concerns/facetable.rb index a3717e7ad..abe46157b 100644 --- a/app/controllers/concerns/facetable.rb +++ b/app/controllers/concerns/facetable.rb @@ -262,7 +262,7 @@ def facet_by_registrants(arr) end def providers_totals(arr) - providers = Provider.all.pluck(:symbol, :name).to_h + providers = Provider.unscoped.where("allocator.role_name IN ('ROLE_FOR_PROFIT_PROVIDER', 'ROLE_CONTRACTUAL_PROVIDER', 'ROLE_CONSORTIUM' , 'ROLE_CONSORTIUM_ORGANIZATION', 'ROLE_ALLOCATOR')").where(deleted_at: nil).pluck(:symbol, :name).to_h arr.map do |hsh| { "id" => hsh["key"], diff --git a/spec/requests/providers_spec.rb b/spec/requests/providers_spec.rb index fd069202f..2859767f4 100644 --- a/spec/requests/providers_spec.rb +++ b/spec/requests/providers_spec.rb @@ -126,6 +126,7 @@ describe 'GET /providers/totals' do let(:provider) { create(:provider) } + let(:ra) { create(:provider, role_name: "ROLE_REGISTRATION_AGENCY") } let(:client) { create(:client, provider: provider) } let!(:prefixes) { create_list(:prefix, 10) } let!(:dois) { create_list(:doi, 3, client: client, aasm_state: "findable") }