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.

:from broken in will_paginate

#244


User.paginate(:all, :from => 'users', :page => 1)

yields this error:


ArgumentError: Unknown key(s): from

This works:


User.find(:all, :from => 'users')

This example is silly, but I use the :from param to force the use of indexes, which is not so silly. Am I missing something, or is this a bug?

Reported by Ken-ichi Ueda · September 17th, 2008 @ 01:14 AM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

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

    You must be missing something. will_paginate ignores and forwards every parameter that it doesn't recognize, like :from.

    Your example works in will_paginate and in commit 39e77cf I've added a test to prove it.

    October 7th, 2008 @ 10:26 AM

  2. Mislav
    Mislav
    • State changed from invalid to resolved

    Ah, now I see that this fails on Rails versions before 2.1 because find() supports :from, but count() doesn't.

    Fixed in 1449867

    October 7th, 2008 @ 11:34 AM

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.