will_paginate not working with group by clause #167

Closed
andrerpbts opened this Issue Aug 22, 2011 · 1 comment

Projects

None yet

3 participants

@andrerpbts

The pagination isn't ocurring when I put group statement on my search (Rails 3.0.9, will_paginate 3.0.0). When I checked for 'any?' method in my collection, I got this following error:
undefined method `<=' for {3=>3, 4=>6}:ActiveSupport::OrderedHash

My code:
mats = Mat.group('name').paginate(:page => params[:page], :per_page => 15)

Removing the group method from this search, the pagination shows up again. But my collection always build up the table with the correct data, even the number of lines showed is the same as defined in :per_page parameter. Only the navigation links aren't showing...

@phene

The following pull request will fix this issue: #178

@mislav mislav closed this in 8ce2276 Sep 8, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment