Best place to store model specific constants in rails 3.1?

后端 未结 4 1053
遥遥无期
遥遥无期 2021-01-31 04:54

I have a field type in a model called user which is an int in the db. The value of the int speficies the type of store it is. Example:

4条回答
  •  感动是毒
    2021-01-31 05:22

    You should avoid using "type" as a model's column name unless you use Single Table Inheritance.

    http://api.rubyonrails.org/classes/ActiveRecord/Base.html#class-ActiveRecord::Base-label-Single+table+inheritance

提交回复
热议问题