How can i count total number of user registerd with their respective roles?
I have a buying and selling rails app, where users have two roles buyers and sellers i want to show records on my homepage that how many buyers are there on the site and how many sellers on the site.
but by using the User.count it shows all the user registered on my site
['buyer', 'seller'].each do |role|
class Role < ActiveRecord::Base