Runs the validations on this model. You can
also pass it an array of attributes to run only those attributes.
It returns nothing if there are no errors, or an object
of errors by attribute.
To use validations, it's suggested you use the
model/validations plugin.
$.Model("Task",{
init : function(){
this.validatePresenceOf("dueDate")
}
},{});
var task = new Task(),
errors = task.errors()
errors.dueDate[0] //-> "can't be empty"
Runs the validations on this model. You can also pass it an array of attributes to run only those attributes. It returns nothing if there are no errors, or an object of errors by attribute.
To use validations, it's suggested you use the model/validations plugin.