Skip to content
This repository

custom data in Backbone.sync #154

dvv opened this Issue December 21, 2010 · 3 comments

2 participants

Vladimir Dronnikov Jeremy Ashkenas
Vladimir Dronnikov -- possible to check whether model already is a string and suppress JSON.stringify(model.toJSON()) if yes?

The rationale is to provide for ability to pass custom data and thus making all custom ajax calls consistently via Backbone.sync()


Jeremy Ashkenas

We could do that, but why not just pass the data as a JS object?

Also, you should be able to set to any value you desire.

Vladimir Dronnikov

There's no chance to pass since we'll get first TypeError on: 1) null/undefined model; 2) object w/o .toJSON(). So one must pass an object looking like a valid model even if he wants to just pass

Thus the issue.

Jeremy Ashkenas

Alright -- I've made a viable solution with the patch at SHA: 4c1bdb4. Thanks for the ticket.

Jason Webster jasonwebster referenced this issue from a commit in jasonwebster/backbone December 30, 2010
Jeremy Ashkenas Issue #154. Make possible for creates and updates with t…
…he default sync.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.