The comments state that _validate should Run validation against a set of incoming attributes, returningtrueif all is well, yet the first thing it does is obliterate what it's been passed by extending attrs to include every single attribute in the model object:
Run validation against a set of incoming attributes, returning
if all is well
I can't say whether this is a good thing or a bad thing, but it's not what I would expect to happen by looking at the method signature and documentation. Validating everything all the time regardless of whether or not it's been changed seems a bit wasteful, and it makes unit testing validations more difficult than they need to be because you can't simply have a spy assert that the success callback hasn't been called after setting an invalid value. With this approach, the success callback may actually be called dozens of times before the one bad attribute you actually wanted to validate bombs out.
Thanks -- I've updated the comment. The change in validate() was made with 0.9 because most folks using validate wanted to have a stateless method that ensured that the model was in a valid state, given the upcoming snapshot of what the attributes would become as a whole.