I would like to create a custom validation method within my model and use some existing validators (specifically, validates_numericality_of
) within the custom validation method.
Is this possible? If so, how do I do it?
For some context: We are using a non-ActiveRecord ORM that has an attribute that is a Hash. I want to perform validations on stuff inside the hash. If there is a way to do that, like validates_numericality_of :my_attribute.:subattribute
or something, that would be fine too.
Thank you.