I have a model and I am using Single Table Inheritance. This has a type column in my database which is populated with the string of the class name.
Should I validate this column?
Options:
- required column in the db
validates :type, presence: truevalidates :type, inclusion: {in: [Class1.to_s, Class2.to_s]}
Since
ActiveRecordhandles thetypefield you don't need to write extra validations on this field.