The solution I found is adding a serializer providing the following configuration:
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
exchange: {
embedded: 'always',
serialize: 'id'
}
},
...
My model attribute id exchange
and I have a DS.belongsTo
relationship. With hasMany
I guess you could use something like this:
//serializers/user.js
export default DS.RESTSerializer.extend(DS.EmbeddedRecordsMixin, {
attrs: {
conversation: {
embedded: 'always',
serialize: 'ids'
}
},
...