This project is archived and is in readonly mode.

#6620 ✓resolved
Joshua Kifer

relation batch_order doesn't quote table and column names

Reported by Joshua Kifer | March 24th, 2011 @ 10:24 PM

Thus if I'm using singular table names on postgres and querying against user it throws a syntax error because it's a reserved word (keyword). This showed up when trying to index on heroku with sunspot rails (solr).

The fix:

In batch_order in lib/active_record/relation/batches.rb change:

"#{@klass.table_name}.#{@klass.primary_key} ASC"

to:

"\"#{@klass.table_name}\".\"#{@klass.primary_key}\" ASC"

Comments and changes to this ticket

Create your profile

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

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages