Using Repo.aggregate() to count the total of elements is incompatible with group_by(). Changing this to a subquery with a count(*) of results permit to use group_by().
Using Repo.aggregate() to count the total of elements is incompatible with group_by(). Changing this to a subquery with a count(*) of results permit to use group_by().