ardent
ardent copied to clipboard
Validate input but not store it in the database
How would I validate that a boolean input (a checkbox for example) is true, but not store its value in the database?
You can use the validate or validateUniques methods on your ardent model both methods will return a boolean and populate the models validation validationErrors property if there are errors.
The difference between the two methods is that the validateUniques method will update any unique constraint rules so they work correctly when updating a record (so it doesn't validate against itself)