ActiveRecord automatic quoted identifiers

J

Jeremy

Is there a way to tell ActiveRecord to automatically quote all
table/column/etc. identifiers in the SQL that it generates? I just
upgraded to MySql 5 and we have a database table named "Release"...
This is a new reserved word. Bummer.

I want ActiveRecord to automatically generate SQL like:

SELECT `name` FROM `Release`
instead of:
SELECT name FROM Release

I can use ActiveRecord::Base#set_table_name to deal with this
particular case but it seems like a bit of a hack. Anyone know if
there's a global setting for this in database.yml or something?

Jeremy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top