I am using Ruby on Rails 3.1.0 and I would like to know if it is possible to name a database table column with the word type without incurring into problems (I know that the “type” word is used in Polymorphic Associations…). Is it?
And if I would like to use, for example, a database table name as article_type, what kind of problems can I have (without using a Polymorphic Association)?
Yes it is.
You can use the
typecolumn if you define this in your model:Having a table called
article_typewouldn’t matter to Rails. It’s only thetypecolumn that it is protective of.