#150 ✓resolved
darix

:select broken with will_paginate

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

@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

Comments and changes to this ticket

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Everyone's favorite Ruby library for pagination of practically anything!

People watching this ticket

Pages