ruby-on-railsruby-on-rails-5activemodelsingle-table-inheritancesti

Should I validate the type column? (Rails, STI)


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:


Solution

  • Since ActiveRecord handles the type field you don't need to write extra validations on this field.