When I save a Parent object (which has many Child objects), the relationship is seemingly broken. The Ember docs are silent on this issue.
What do I need to do so th
This is an issue with the JSONSerializer and hasMany relationships. You can check this 'fixed' jsbin: http://jsbin.com/zodorule/13
Refer to this issue: http://discuss.emberjs.com/t/ember-data-fixture-adapter-saving-record-loses-has-many-relationships/2821
I added this to your code and it works:
DS.JSONSerializer.reopen({
serializeHasMany : function(record, json, relationship) {
var key = relationship.key;
var relationshipType = DS.RelationshipChange.determineRelationshipType(
record.constructor, relationship);
if (relationshipType === 'manyToNone'
|| relationshipType === 'manyToMany'
|| relationshipType === 'manyToOne') {
json[key] = Ember.get(record, key).mapBy('id');
// TODO support for polymorphic manyToNone and manyToMany
// relationships
}
}
});