[ActiveRecord] Feature proposal: Defining a custom column name for an attribute

Sometimes you need to work with databases which you can't alter, where it would be useful to use column names that are different from a model's attribute names. Similar to a custom table_name. One such example is a database table with an 'attribute' column, which won't work with Rails. Another example might be legacy databases with an inconvenient naming which you'd rather not use in the Rails app.

The column name would only be used in the actual SQL queries, and the attribute name anywhere else.

There is alias_attribute, which gets close to it, but doesn't work for either of the two examples.

How tightly coupled are attribute and column names and would it be feasible to add this feature?

Thanks jomo