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


-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at https://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to