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 anActiveRecord::Relation
object, so assigning it tothis
blows up when trying to create an instance variable. We'll need to amend theis_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 withdemodulize
. -
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 fromWillPaginate::Finders::ActiveRecord::Pagination
. Notably,origin
andorigin_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
-
Matt Jones August 14th, 2011 @ 07:02 PM
- State changed from new to resolved
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป