I've got an array of symbols and I would like to use validate_inclusion_of
to verify that a field in my model is one of those values in the array. The issue is that the field being compared is a string.
Obviously I could convert the array to store strings or pass a lambda to the in:
argument which converts the symbols to strings at runtime, but I would rather be able to somehow perform to_sym
on the field being compared before checking against the array. Is this possible?