better piechart of origins

This commit is contained in:
Felix Van der Jeugt 2015-09-14 16:17:01 +02:00
parent 6a86a418eb
commit d0d7510532

View file

@ -18,9 +18,9 @@ class Statistics < Rails::Application
end end
def by_issuer def by_issuer
Transaction.group(:issuer_id).count.inject(Hash.new) do |hash, (id, count)| Client.joins(:issued_transactions).group(:name).count.merge({
hash.merge({User.find(id).name => count}) "User created" => Transaction.where(issuer_type: "User").count
end })
end end
def amount_distribution def amount_distribution