#29 ✓resolved
Mike Garey

will_paginate: fails when using :group option

Reported by Mike Garey | June 11th, 2007 @ 01:09 AM

when using the :group option with Rails 1.2.3, ActiveRecord will return an ordered hash which causes a problem with the count statement on line 28 of the file finder.rb. The following error is returned:

undefined method `to_i' for #<activesupport::orderedhash:0x99c4470>

this can be fixed by using the following:

num = count(count_options)

num.class == Fixnum ? num : num.length

unless there's a better way of doing it..

also, the following code on line 27 needs to be merge! and not merge, since merge returns a new hash, rather than modifying it in place, as was intended.

count_options.merge(options.delete(:count)) if options[:count]

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Everyone's favorite Ruby library for pagination of practically anything!

People watching this ticket

Referenced by

Pages