Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

will_paginate Collection class clash

#27

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

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

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to resolved

    (from [241]) Explicitly return WillPaginate::Collection [John Leach] [#27 state:resolved]

    http://require.errtheblog.com/pl...

    May 31st, 2007 @ 11:01 PM

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.