I have an issue with ember-data and adding objects to a hasMany relationship.
I am using the JSONAPI adapter and serializer.
var model = this.store.peekRecord("model", "id");
var related = this.store.peekRecord("related-model", "id");
model.get("relationField").then(function(relations) {
relations.addObject(related);
model.save();
});
The generated request does not contain any relationship attributes, neither the currently existing ones nor the newly added one.
{"data":{"type":"user_roles","id":"admin","attributes":{"name":"admin"}}}
Any hints?