I had used a default scope to order the User. When I changed the query to User.unscope(:order).group(:type).count it worked properly.
This pushes me to agree with people who warn against using any default scopes.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkRead more