documentcloud/backbone — pull request #1869 by tgriesser (2012-12-04 23:51:07+00:00)
Title: Proposed fix for #1477

As pointed out in #1477, the forced `silent:true` in the Collection's `.reset` prevents any model validation calls from being triggered. in the majority of cases it can be safely assumed that any data used to creating/resetting a collection is already filtered, and the model's validate doesn't have to be called on every model going in.

However - there could be instances where this isn't the case, and removing `{silent:true}` isn't the answer because that would trigger `add/set` for every model going in. So this pull request adds a check for a `validate` function on the collection - which would serve as the appropriate place for a validation check on the incoming model data to take place (after it is parsed, but before anything else).

Tests included.