Fixed count method to handle results with group by clause #226

jgwconsulting opened this Issue Feb 17, 2012 · 1 comment

1 participant


As already noted, the count method fails to work correctly for queries with a group by clause. To fix, just self.except :group as well as the others, which is less hacky than handling the resulting hash after the fact.

It's in my fork, now I just need to read about Pull Requests, as I'm not entirely sure what they are or how to make one. Oh, I should probably write a test for it as well, I guess...


Oooops, except that won't work at all. Would actually need to wrap the original query in a select count(*) as suggested by Brad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment