From be209e623df8397b77fffcd8d508a774afcc664a Mon Sep 17 00:00:00 2001 From: Adam George Date: Wed, 21 Nov 2012 14:34:15 +1100 Subject: [PATCH] Pass options through to toJSON This is useful if you have overriden toJSON with own implemention and need to pass some options through --- backbone.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backbone.js b/backbone.js index dcbae71d..14028827 100644 --- a/backbone.js +++ b/backbone.js @@ -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.