nealstewart/backbone.validations — pull request #38 by asheriff (2013-04-25 19:29:09+00:00)
Title: Skip validations when required set to false and value is null or undefined

When required is set to false the other validators on the attrubute are only run if the new attribute value is not null or undefined.

```js
var Foo = Backbone.Model.extend({
validate: {
age: {
type: 'number'
}
}
});

var foo = new Foo();
foo.set({blah: 'xyzzy'}); // => false
foo.isValid(); // => false

var Bar = Backbone.Model.extend({
validate: {
age: {
type: 'number',
required: false
}
}
});

var bar = new Bar();
bar.set({blah: 'xyzzy'}); // => bar
bar.isValid(); // => true
bar.set({age: 'old'}); // => false
bar.set({age: 1});
bar.isValid(); // => true
```