Validations
Last updated
Last updated
All database errors are added to the errors
array used by Granite::ORM::Validators with the symbol ':base'
If you require to add more data validation to your model, you can do so by using the validate
method.
validate
method can be used to validate the whole object or an attribute of the object. These validations are not automatically checked when you save, to do so you need to run the .valid?
method.
Example:
Example: