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.

:select broken with will_paginate

#150
@users = User.paginate :page => params[:page], :order => 'login', :per_page => 30 , :select => 'login, fullname'

gives you the following SQL error.

Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' fullname) AS count_login_fullname FROM users' at line 1: SELECT count(login, fullname) AS count_login_fullname FROM users
User.find :select => 'login, fullname'

properly generates

SELECT login, fullname FROM users

Reported by darix · November 8th, 2007 @ 10:42 PM

State: resolved
Milestone: none
Assigned to: Mislav Mislav

Activity

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

    November 10th, 2007 @ 02:59 AM

  2. Mislav
    Mislav
    • State changed from open to resolved

    This was resolved a long time ago, closing the ticket. Report if I'm wrong.

    January 31st, 2008 @ 11:14 PM

  3. Yong Bakos
    Yong Bakos
    • Tag set to count, options, sql, will_paginate

    Actually, this bug still emerges when attempting a SELECT DISTINCT * (:select => 'DISTINCT *')

    August 18th, 2008 @ 10:01 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.