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.

Incorrect counts when using rails 2.3 :having option and scopes

#264

I'm using rails 2.3 and have a named_scope that uses the :having option to filter results based on joined aggregate data. When using will_paginate with this, the :having (and :group) options from the scope are not passed through to the count method, so the page count it calculates is inaccurate. I have attached the patch I made to resolve this. It probably needs some work but it resolved my immediate need. It basically ensures that the :having and :group options are pulled from the scope and ONLY if they weren't explicity defined when calling paginate.

Reported by Blane Dabney · March 3rd, 2009 @ 07:07 PM

State: open
Milestone: none
Assigned to: Mislav Mislav

Activity

  1. Mislav
    Mislav
    • State changed from new to open

    That's a good explanation. I will look into it

    March 3rd, 2009 @ 07:10 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.