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 should clone query strings

#235

to avoid regenerating a query string over and over, i reuse the same query. for example:

@@my_q = "select custom,other,and,another from cats where blah = 'blah'"

i then do:

Cat.paginate_by_sql(@@my_q, 1, 13)

and deep inside paginate_by_sql (lib/will_paginate/finder.rb:133) it does this:

add_limit! query, :offset => pager.offset, :limit => pager.per_page

which destructively changes the string. the .dup business in the lines above almost avoids modifying the input string, but barely misses.

Reported by rgiar · June 30th, 2008 @ 06:39 AM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Mislav
    Mislav
    • State changed from open to resolved

    Fixed in commit f54bc39

    August 27th, 2008 @ 11:40 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.