Serialising async hasMany relationships

前端 未结 1 1409
Happy的楠姐
Happy的楠姐 2021-01-03 03:39

I\'m fairly new to EmberJS, and I\'ve been fiddling around for most of the evening trying to persist some hasMany and many to many relationships in a new app that I\'m worki

1条回答
  •  天涯浪人
    2021-01-03 04:11

    In my understanding, the reason that the active model serializer skips has many relations is that it expects the backend to handle it. In a relational database, the values of a has many are not explicitly saved on the parent record. It is sufficient to save the foreign key in the child. When you ask for a cleaner solution - perhaps ActiveModelSerializer is not the best fit for your API.

    0 讨论(0)
提交回复
热议问题