Merge pull request #1152 from braddunbar/implicit-tojson

toJSON is called implicitly.
This commit is contained in:
Jeremy Ashkenas
2012-03-29 07:49:04 -07:00

View File

@@ -1329,7 +1329,7 @@
// Ensure that we have the appropriate request data.
if (!options.data && model && (method == 'create' || method == 'update')) {
params.contentType = 'application/json';
params.data = JSON.stringify(model.toJSON());
params.data = JSON.stringify(model);
}
// For older servers, emulate JSON by encoding the request into an HTML-form.