-
-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
Relations are not applied if one of the relation is null.
Exemple:
relations() {
return {
post: Post,
comments: Comment,
};
}and database response
{
post: null,
comments: [
{title: 'hello world'}
]
}
will not apply the relation on comments.
Maybe _applyRelations should just ignore null values rather than ending the loop :
_applyRelations(model) {
const relations = model.relations()
for(const relation of Object.keys(relations)) {
const _relation = getProp(model, relation)
if (!_relation) {
return;
}
JoaoPedroAS51
Metadata
Metadata
Assignees
Labels
No labels