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
def by_issuer
Transaction.group(:issuer_id).count.inject(Hash.new) do |hash, (id, count)|
hash.merge({User.find(id).name => count})
end
Client.joins(:issued_transactions).group(:name).count.merge({
"User created" => Transaction.where(issuer_type: "User").count
})
end
def amount_distribution