CMVentures/backbone-associations — pull request #1 by bwirth-cm (2014-11-20 20:24:46+00:00)
Title: Changed serialization to default to include id values

@brendancustommade @davecm

Here's the PR and the things i want to change. Addressing some of your concerns:

1. the toJSON method is one of the most valuable pieces to backbone-associations... so i don't want to just override it if i don't have to.
2. the toJSON method is not terribly configurable by the options unfortunately... driving me to tweak the function itself

As far as the features i added:
1. this.idAttribute is always included. And the default is to go to an idAttribute
2. By default, it flattens objects with only one item (an id) to a value, not an object. There's an option.noFlatten to override.
3. If you want to serialize everything, i added an option.allData.