From 37ea092c7cdd34a8c49baea4642feba4492b2204 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Fri, 27 Nov 2020 06:38:25 +0100 Subject: [PATCH] simplify db query. #676 --- app/controllers/exports_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/exports_controller.rb b/app/controllers/exports_controller.rb index 049d5e604..8b3b814cf 100644 --- a/app/controllers/exports_controller.rb +++ b/app/controllers/exports_controller.rb @@ -396,7 +396,7 @@ def repositories csv = headers.to_csv # get doi counts from database - dois_by_client = DataciteDoi.where(type: "DataciteDoi").where(aasm_state: ["findable", "registered"]).group(:datacentre).count + dois_by_client = DataciteDoi.where.not(aasm_state: "draft").group(:datacentre).count clients.each do |client| # Limit for salesforce default of max 80 chars