ActiveRecord automatic quoted identifiers

Discussion in 'Ruby' started by Jeremy, Jan 25, 2006.

  1. Jeremy

    Jeremy Guest

    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
    Jeremy, Jan 25, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Guest
    Replies:
    1
    Views:
    748
    Guest
    Jun 29, 2004
  2. flarosa
    Replies:
    6
    Views:
    11,937
    flarosa
    Apr 11, 2006
  3. Frank Olieu
    Replies:
    5
    Views:
    2,127
    Vinayak
    Nov 28, 2005
  4. Diez B. Roggisch
    Replies:
    1
    Views:
    295
    Satya Arjunan
    Dec 11, 2003
  5. Replies:
    1
    Views:
    335
    Roedy Green
    Apr 22, 2008
Loading...

Share This Page