documentcloud/backbone — pull request #853 by emeryamiller (2012-01-11 20:12:37+00:00)
Title: Validation can determine if the document is about to be saved, and validations can be skipped

Added two new options that can be used during validations:

* skipValidation: true - obviously skips the validation process while updating the model.
* saving: true - this is passed to the validation function automatically when a save call is made on the model. It allows the validation logic to be sensitive to whether or not a save is happening.

The main reason for this is to allow a model to enter an invalid state, but still ensure the object is valid before saving.

For example, a person model is being updated by a user. I want the change events to fire because I want other views on the page displaying this data to update as the user types. While a user is editing, they might empty the name field which is invalid, but I want to allow that while still ensuring validation fires when the object is about to saved.