I’m trying to get my custom validation to work on create. But when I do a find then save, rails treats it as create and runs the custom validation. How do I get the validations to only work when creating a new record on not on the update of a found record?
I’m trying to get my custom validation to work on create . But when
Share
Try this on your line of validation code:
this specifies to only run the validation on the
createaction.Source:
ActiveModel/Validations/ClassMethods/validate @ apidock.com