I’ve found lots of bits and pieces to do with how to serialize associations when saving with the ActiveModelAdapter but nothing seems to work.
The most promising looking approach was to simply specify embedded:‘always’ as an option on the association e.g.
var attr = DS.attr;
var belongsTo = DS.belongsTo;
Zapnito.Archive = DS.Model.extend({
video: belongsTo('video', {embedded:'always'}),
durationSeconds: attr('number'),
url: attr('string')
});
and
var attr = DS.attr;
var belongsTo = DS.belongsTo;
Zapnito.Video = DS.Model.extend({
title: attr('string'),
introduction: attr('string'),
archive: belongsTo('archive', {embedded:'always'})
});
but when I try save an archive for instance there’s just a video_id rather than the expected video_attributes property. Is what I’m trying to do possible with the ActiveModelAdapter?