#959 ✓resolved
Matt Jones

will_paginate 3.0.pre4 breaks tons of stuff

Reported by Matt Jones | July 31st, 2011 @ 01:00 AM | in Hobo 1.3 (Rails 3)

Loading up will_paginate 3.0.pre4 breaks a bunch of stuff - even plain vanilla index pages fail.

Key issues, as far as I can determine:

  • SomeModel.paginate now returns an ActiveRecord::Relation object, so assigning it to this blows up when trying to create an instance variable. We'll need to amend the is_a?(Array) check.

  • Not related, but in the same code - assignment to this looks like it would blow up with anything that returns a namespaced name, since .underscore transforms that into a name with a slash and that's invalid in instance variables. We should fix this, probably with demodulize.

  • the attributes added in the fix for #877 don't work anymore - the problem appears to be that the paginate method from WillPaginate::Finders::Base gets overwritten by the methods included from WillPaginate::Finders::ActiveRecord::Pagination. Notably, origin and origin_attribute disappear.

FWIW, the will_paginate pre2 version doesn't have this problem - and the trunk version has collapsed some of the module hierarchy (the Finders module has been removed).

At the very least, we should specify a locked version for will_paginate to avoid confusing new users (who get the pre4 version). I'm not sure if that's the best approach, though...

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 ยป

People watching this ticket

Pages