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.

Perhaps will_paginate's counter should ignore :select

#73

I'm getting funny results when paginating using the :select option. Not exactly sure why, but

SELECT count(DISTINCT table.id)

returns a lower number than

SELECT count(DISTINCT table.id, table.title, table.body, associated_table.etc)

which is what count() generates when using :select.

I'm attaching a one-line patch. I don't think it screws up any of the tests, or although I had to adjust the set-up of those a little to make them run on MySQL. With this patch, my app is now giving consistent numbers of pages with or without :select, so I can get the speed benefits without dropping records on the floor.

One more thing: wasn't sure whether I should modify this plugin rather than the Rails core, but it's here in case you want it. I'll try fixing it in Rails and see if it works as well.

Reported by James Coglan · August 1st, 2007 @ 04:29 PM

State: resolved
Milestone: none
Assigned to: Chris Wanstrath Chris Wanstrath

Activity

  1. Chris Wanstrath
    Chris Wanstrath
    • State changed from new to resolved

    Looks like you're using an old version of will_paginate. Newest revision does ignore :select

    August 1st, 2007 @ 04:29 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.