I have a string column in a table that can have a range of predefined values. It may also include a nil value. For example: dog, cat, bird, zero.
I want to write validates_inclusion_of, which checks that all entered values fall within this predefined range. If, for example, "Nasal Spray" is entered, it will give an error.
What is the best way to do this?
source share