@@ -359,7 +359,7 @@ Validations can also be defined to check the model after the field-specific vali
...
@@ -359,7 +359,7 @@ Validations can also be defined to check the model after the field-specific vali
Model validator methods are called with the model object's context and are deemed to fail if they throw an error, otherwise pass. This is just the same as with custom field-specific validators.
Model validator methods are called with the model object's context and are deemed to fail if they throw an error, otherwise pass. This is just the same as with custom field-specific validators.
Any error messages collected are put in the validation result object alongside the field validation errors, with keys named after the failed validation method's key in the `validate` option object. Even though there can only be one error message for each model validation method at any one time, it is presented as a single string error in an array, to maximize consistency with the field errors.(Note that the structure of `validate()`'s output is scheduled to change in `v2.0`to avoid this awkward situation. In the mean time, an error is issued if a field exists with the same name as a custom model validation.)
Any error messages collected are put in the validation result object alongside the field validation errors, with keys named after the failed validation method's key in the `validate` option object. Even though there can only be one error message for each model validation method at any one time, it is presented as a single string error in an array, to maximize consistency with the field errors.