From 6270de1f33f3ee09c72c4f77799800a4c5a2f0e0 Mon Sep 17 00:00:00 2001 From: Martin Fenner Date: Thu, 26 Nov 2020 11:49:28 +0100 Subject: [PATCH] show doi counts for all repositories. #676 --- app/models/client.rb | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/models/client.rb b/app/models/client.rb index 558a651a0..76892b4c8 100644 --- a/app/models/client.rb +++ b/app/models/client.rb @@ -672,25 +672,25 @@ def self.export_doi_counts(query: nil) db_total = dois_by_client.dig(client.id).to_i es_total = client_totals[client.uid] ? client_totals[client.uid]["count"] : 0 - if (db_total - es_total) > 0 - # Limit for salesforce default of max 80 chars - name = +client.name.truncate(80) - # Clean the name to remove quotes, which can break csv parsers - name.gsub!(/["']/, "") - - row = { - accountName: name, - fabricaAccountId: client.symbol, - parentFabricaAccountId: - client.provider.present? ? client.provider.symbol : nil, - doisCountTotal: db_total, - doisMissing: db_total - es_total, - }.values - - puts CSV.generate_line(row) - - sum << CSV.generate_line(row) - end + # if (db_total - es_total) > 0 + # Limit for salesforce default of max 80 chars + name = +client.name.truncate(80) + # Clean the name to remove quotes, which can break csv parsers + name.gsub!(/["']/, "") + + row = { + accountName: name, + fabricaAccountId: client.symbol, + parentFabricaAccountId: + client.provider.present? ? client.provider.symbol : nil, + doisCountTotal: db_total, + doisMissing: db_total - es_total, + }.values + + puts CSV.generate_line(row) + + sum << CSV.generate_line(row) + # end sum end