Pass options through to toJSON

This is useful if you have overriden toJSON with own implemention and
need to pass some options through
This commit is contained in:
Adam George
2012-11-21 14:34:15 +11:00
parent 900c4fec97
commit be209e623d

View File

@@ -1381,7 +1381,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);
params.data = JSON.stringify(model.toJSON(options));
}
// For older servers, emulate JSON by encoding the request into an HTML-form.