#27 ✓resolved
John Leach

will_paginate Collection class clash

Reported by John Leach | May 31st, 2007 @ 11:01 PM

HI, I've been using will_paginate for a couple of days in development mode and it's been great. But today I deployed something with it and it all went craptastic - finder.rb returns a new Collection object, but I already have a rails model named Collection! I guess it works in development mode due to the class reloading magic.

Anyway, long story short, one line fix:

--- will_paginate/lib/will_paginate/finder.rb (revision 128)

+++ will_paginate/lib/will_paginate/finder.rb (working copy)

@@ -38,7 +38,7 @@

finder.sub! /^find/, 'find_all'

end

- returning Collection.new(

+ returning WillPaginate::Collection.new(

(options.delete(:page) || 1),

(options.delete(:per_page) || per_page),

total_entries

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

Pages