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 breakage starting in r203

#17

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.

Reported by Ryan Platte · May 18th, 2007 @ 12:26 PM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to open
    • Assigned user changed from Chris Wanstrath to Mislav

    May 18th, 2007 @ 12:26 PM

  2. PJ Hyett
    PJ Hyett

    This is probably due to the changed API, I'll be making a post shortly about Will Paginate 2.0.

    May 18th, 2007 @ 12:26 PM

  3. Mislav
    Mislav
    • 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.)

    May 18th, 2007 @ 12:26 PM

  4. Ryan Platte
    Ryan Platte

    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.

    May 18th, 2007 @ 12:26 PM

  5. Mislav
    Mislav

    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' %>
    

    May 18th, 2007 @ 12:26 PM

  6. Ryan Platte
    Ryan Platte

    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.

    May 18th, 2007 @ 12:26 PM

  7. alterecco
    alterecco

    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

    May 18th, 2007 @ 12:26 PM

  8. Mislav
    Mislav

    So it was confirmed. Reopening this...

    May 18th, 2007 @ 12:26 PM

  9. Mislav
    Mislav
    • State changed from resolved to open

    May 18th, 2007 @ 12:26 PM

  10. Chris Wanstrath
    Chris Wanstrath
    • State changed from open to resolved

    (from [223]) Namespacing issue with Hash, now #slice works fine [#17 state:resolved]

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

    May 18th, 2007 @ 12:26 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.