vendredi 11 mars 2016

Models with hasMany relationships have no values or attributes after update to 1.13

I've updated ember-data from 1.0.-beta.19.2 to 1.13.16 and my model "sheet" has a hasMany relationship ({ async: true, embedded: 'always' }) to another model "elements", which itself has a hasMany relationship to another model "steps" ({ async: true}). If I want to access steps in an observer in the elements model, it has no attributes or values. I've tried to make steps non async, because I don't know if that makes sense in an embedded record, but that didn't help.

My serializers for these models look like this

sheet:

export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
    isNewSerializerAPI: true,
    attrs: {
        elements: { embedded: 'always' },
        parent: { serialize: 'ids',  deserialize: 'records' }
    }
});

element:

export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
    isNewSerializerAPI: true,
    attrs: {
        steps: { embedded: 'always' }
    }
});

Aucun commentaire:

Enregistrer un commentaire