I believe that you’ll need to use the EmbeddedRecordsMixin in your Serializer. For example, your serializer (assuming that you’re using the ActiveModelSerializer) would look like this:
What zaid is correct.
The standard is that you save the parent_id on the child (for a hasMany relation). so you would need to save the childs as well to save the relation.
Or you tell ember to only serialize id’s on the parent .
category: {
child_ids: [ 1,2,3 ],
parent_id: 2
}
It might be best to read through this:
As said… The standard (I hope Im still correct with that) is at a 1:n relation that you save the parent_id on the child. Any other way needs to be set up.
First thank you for your help, but I think that there is another problem.
I use the RESTAdapter with the standard RESTSerializer. If I save any other model that has a hasMany relationship, then the hasMany property exists in payload but here it looks like this:
The children property isn’t there. Does this problem exist only because of “inverse: true”?