The API does not support returning sideloaded relationships. Instead, it works by providing a nested path to load relationships, like: /libraries/:id/groups.
How can I change the RESTAdapter to get this working?
I see, thank you for your answer. Indeed I do not have control over the API. Could I do something in the serializer where I automatically add a ‘link’ property to my payload to fake that the server responded with it? This way I can use Ember Data in the way it is intended (model.get('groups') not this.store.find('group', { type: 'library', library:{library_id} })).
If it is possible, can you show me how? I am still not sure how serializers tie in with everything else.
I’m pretty sure you can do that, but I also don’t know much about the serializer. I saw another thread where someone mentioned hacking the link property into the serializer. I would try something like this first:
That did the trick. Now I wish there was a way to do something like this globally for an adapter, not model per model (since the entire API is built like that). I know there’s the ApplicationAdapter but this is not usable for me since I have more than 1 backend I am integrating against.