angular-restmod icon indicating copy to clipboard operation
angular-restmod copied to clipboard

Relation hasOne does not sideload model

Open maufl opened this issue 10 years ago • 1 comments

I have a model A that has a hasOne relation to another model B. When I fetch the model A and B is contained in the 'linked' element of the response, it is still not loaded. However, if I change the relation to a belongsTo relation it works as expected.

maufl avatar Dec 08 '15 14:12 maufl

hasOne and belongsTo is really meant to do the same as they are doing with your case. hasOne only loads the data when it is inlined and belongsTo loads data when it is separated and passed into linked object. Hope this answer your question.

utf4 avatar Nov 03 '16 18:11 utf4