platanus / angular-restmod

Rails inspired REST-API ORM for Angular
http://platanus.github.io/angular-restmod/
MIT License
1.18k stars 87 forks source link

Relation hasOne does not sideload model #361

Open maufl opened 8 years ago

maufl commented 8 years ago

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.

utf4 commented 7 years ago

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.