emberjs/data — pull request #225 by oruen (2012-04-25 04:36:42+00:00)
Title: Serialization of custom association's key.

I've run into a bug with custom association key of hasMany association.
In my app there is a model like that:

App.set('Anchor', DS.Model.extend(
people: DS.hasMany('Markapp.Person', {key: 'person_ids'})
)

Trying to serialize model's instance I've got `{id:1, people: [2,3]}` instead of expected `{id:1, person_ids: [2,3]}`.

While fixing that I've figured out belongTo association has the same bug. I've wrote test cases for external hasMany association, embedded and external belongsTo association. Working on the solution I've realized I'm not completely sure if embedded belongsTo association could have a `key` option. So the test for it is not passing now. If it could, the solution would not be that straightforward as for other cases.

Please let me know of the proper belongsTo behavior so I could finish my patch.