Defining embedded records should not be declared only inside EmbeddedRecordsMixin


Let’s say that I have a survey that hasMany questions. In one case I want ember to fetch questions using async: true, where in another case (for instance when the survey is distributed to the public) I want ember to fetch questions as part of the GET /surveys/:id response, that is, I want questions to be embedded. Atm I have to declare 2 models, one for survey and questions when admins create/update/delete them (using async: true) and one for the public (public-survey, public-questions) in order to filter out which records I want embedded from EmbeddedRecordsMixin.


This is a common issue for me as well. Ideally ember-data would decide whether or not to make a relationship async based on the payload that it receives. That way you could specify which relationships should be included on a case by case basis. The most obvious example is list vs detail views. This isn’t possible with the current api because it’s different for sync vs async relationships. I believe there’s a move towards using the async api for all relationships in which case it would be possible.