logicalparadox/backbone.iobind — Issue #6: Sending custom data with fetch() method
Author: jkirkwood
Created: 2011-12-31 17:07:52+00:00
State: open

I was trying to do something like:

```Tasks.fetch({data: {project: id}});```

in order to fetch all tasks associated with given project, following what the Backbone documentation recommends. I noticed that the project id wasn't making it to node, however, when using iosync. I did a little digging and found this on line 56 of the iosync code:

```params.data = model.toJSON() || {};```

This replaces any data passed as an option of the fetch method with the model data. I modified this to read

```
if( !params.data ) {
params.data = model.toJSON() || {};
}
```

Which sends custom data if it exists, or just the model data if it doesn't.

Is this the correct way to achieve this?