documentcloud/backbone — Issue #904: Model.save no longer passes the model to the error callback
Author: elliterate
Created: 2012-01-30 23:44:44+00:00
State: open

When `Model.save` is given an error callback, that callback is not receiving the model in its arguments. Instead, it receives the response object twice.

model.save({}, {
error: function(model, response) {
// model === response
}
);

This appears to have been broken by the combination of afc2d99b4632aca90f5c8d779541a0c655e621de and 18be7107c7413d921e948df64b87558ce0fc0648.

Presumably, this just needs `originalModel` to be passed to the callback instead of `model`. @joneath and I couldn't figure out a good way to test this, though, as the test suite is overwriting `$.ajax` in a way that never actually calls the error callback.