camelize database calls

I have legacy Sql Server database and Rails applications. Column names in database are all in PascalCase (FirstName, CustomerId...).

I'm searching for an easy way to use underscore_casing in Ruby and PascalCasing in database. I would like to write first_name in Rails for FirstName column in database.

Just like translating Ruby in rjs templates to JavaScript cameCase convention.

The best I found so far is a start of writing plugin: http://code.google.com/p/rails-mssql-tools/

Any advice would be great. Thanks, Igor.

camelize and underscore will convert a string to required casing

but I'm looking for something more general like: ActiveRecord::Base.camelize_table_column_names = true :slight_smile:

like existing ActiveRecord::Base.pluralize_table_names