Skip to content

Commit

Permalink
show doi counts for all repositories. #676
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Nov 26, 2020
1 parent 5c9de77 commit 6270de1
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions app/models/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6270de1

Please sign in to comment.