will_paginate breakage starting in r203
Reported by Ryan Platte | May 18th, 2007 @ 12:26 PM
I have a functional test that blows up on will_paginate/lib/finder.rb:26 looking for a missing Hash#slice. When I use will_paginate r202, all's well. Starting with r203, breakage. I noticed this at r219 and worked backwards.
Comments and changes to this ticket
-
Chris Wanstrath May 18th, 2007 @ 12:26 PM
- State changed from new to open
- Assigned user changed from Chris Wanstrath to Mislav
-
PJ Hyett May 18th, 2007 @ 12:26 PM
This is probably due to the changed API, I'll be making a post shortly about Will Paginate 2.0.
-
Mislav May 18th, 2007 @ 12:26 PM
- State changed from open to resolved
Fixed in [221]. But, your old pagination code is probably obsolete; refer to the README to learn how to update. (It should take you 10 minutes at most once you read it.)
-
Ryan Platte May 18th, 2007 @ 12:26 PM
No, it still breaks in 221 with the same error. I can switch the pegged version back and forth: r202 works, but r203, r219, and r221 all break with this error.
I also read the README and didn't see instructions for upgrading.
-
Mislav May 18th, 2007 @ 12:26 PM
You are saying that it still blows up looking for missing Hash#slice method? That can't be. In [221] I have put the definition in init.rb
I have tested it with gem Rails 1.2.3. Also, there are no specific upgrade instructions in the README, just the regular instructions. You'll notice that the paginate finders return only 1 argument now: the collection.
@people = Person.paginate :page => params[:page]
Also, will_paginate view helper expects the same collection and an options hash, but both are optional.
<%= will_paginate @people, :class => 'pages' %>
-
Ryan Platte May 18th, 2007 @ 12:26 PM
I saw that you put the definition in init.rb -- I have no explanation for why, but yes, it still blows up, and yes, I double-checked to make sure I wasn't seeing things. I will look into it further and try to get you better info and/or a reduction.
Thanks for the upgrade details.
-
alterecco May 18th, 2007 @ 12:26 PM
Experiencing the same breakage as above, i find that if i move the definition to a separate file (eg. hash_helper.rb) and require it in init.rb, it works.
Dont ask me why - i have no clue. In my eyes its merely a hack.
Regards, and thanks for a great plugin
-
Mislav May 18th, 2007 @ 12:26 PM
- State changed from resolved to open
-
Chris Wanstrath May 18th, 2007 @ 12:26 PM
- State changed from open to resolved
(from [223]) Namespacing issue with Hash, now #slice works fine [#17 state: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 ยป
Everyone's favorite Ruby library for pagination of practically anything!