This project is archived and is in readonly mode.
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
-
Repository March 29th, 2011 @ 05:28 PM
- State changed from new to resolved
(from [3ed8a331973b80c49d56b65d726b1f8be52e5261]) Quote find_in_batches ORDER BY clause [#6620 state:resolved] https://github.com/rails/rails/commit/3ed8a331973b80c49d56b65d726b1...
-
Repository March 29th, 2011 @ 05:29 PM
(from [555d0163897601010ab1305f41ed393ec517b61e]) Quote find_in_batches ORDER BY clause [#6620 state:resolved] https://github.com/rails/rails/commit/555d0163897601010ab1305f41ed3...
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
- 6620 relation batch_order doesn't quote table and column names (from [3ed8a331973b80c49d56b65d726b1f8be52e5261]) Quote f...
- 6620 relation batch_order doesn't quote table and column names (from [555d0163897601010ab1305f41ed393ec517b61e]) Quote f...