emberjs/data — pull request #1067 by marcoow (2013-07-03 13:07:56+00:00)
Title: Fixed embedded belongsTo relationships

This fixes an an error where the code

Person = DS.Model.extend({
name: DS.attr('string')
});
Group = DS.Model.extend({
name: DS.attr('string'),
people: DS.hasMany(Person)
});
Person.reopen({
group: DS.belongsTo(Group)
});
Adapter.map(Person, {
group: { embedded: 'always' }
});

store.createRecord(Person, { name: "Tom Dale", group: store.createRecord(Group, { name: "Ember.js Group" }) });
store.commit();

would trigger 2 POST requests (1 to /people, 1 to /groups) where you would only expect 1 (because of group being embedded in person).