title: Automatically upcase column and table names in activerecord
body: <p>I work on a rails application which runs in a few different institutions. It has to interface with a legacy database at each one. All these databases were Oracle and all the column names and table names were in lower case.</p>
  
  <p>One of the institutions has moved their DB to a MS SQL database. The structures are all the same, I've connected the app to it and it looks like it will all work fine, except with one problem.</p>
  
  <p>On the MS SQL db, all the table names and column names are now in uppercase. </p>
  
  <p>Is there a way of making active record automatically translate all the calls to the DB to be uppercase? A method I can override somewhere?</p>
  
  <hr>
  
  <p>So, I think (can't test a lot yet) I've fixed the column name part. I've basically done </p>
  
  <pre><code>column_names.each {|c| alias_attribute c.downcase, c}
  </code></pre>
  
  <p>in each of the affected models (although I've stuck this in a module I can include, or not, depending on the adapter. </p>
  
  <p>I'm trying to work out what to do for the table names which I can lump into the same module.</p>