Not so much an answer as more info on the problem. I'm fighting a similar battle, and what I've found in my case is that when serialization happens the parent
property is a DS.PromiseObject
--this in itself wouldn't be a problem, but at the time serialization is happening it isn't isSettled
…therefore, the Ember Data serialization process picks up undefined
. The property is settled before and after the save, so I'm thinking that the fact that the parent object is being saved also and is refreshing its relationships (or something) is causing the child's parent
property to become unsettled, leading to the problem.
Another part of this puzzle is that the Ember Data serializers actually serialize to a Javascript object, so you internally have an object like this: { "parent": undefined }
, but when that object gets serialized to a string (likely by the browser's toJSON
implementation?) the parent
property gets dropped entirely--and that's what you see go across the wire. And I'm guessing that's why @Jeremy is observing what he's observing.
Now I just have to figure out how to fix it. Anyone???