some cleanup

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
This commit is contained in:
Alexandre Bodin 2020-03-20 11:06:47 +01:00
parent c7f10bfede
commit be24f640d9
2 changed files with 0 additions and 36 deletions

View File

@ -440,47 +440,13 @@ const buildRelation = ({ definition, model, instance, attribute, name }) => {
break;
}
case 'morphOne': {
// const FK = _.find(definition.associations, {
// alias: name,
// });
// const ref = getRef(attribute.model, attribute.plugin);
// setField(name, {
// type: 'virtual',
// ref,
// via: `${FK.via}.ref`,
// justOne: true,
// });
// // Set this info to be able to see if this field is a real database's field.
// attribute.isVirtual = true;
const ref = getRef(attribute.model, attribute.plugin);
setField(name, { type: ObjectId, ref });
break;
}
case 'morphMany': {
// const FK = _.find(definition.associations, {
// alias: name,
// });
// const ref = getRef(attribute.collection, attribute.plugin);
// setField(name, {
// type: 'virtual',
// ref,
// via: `${FK.via}.ref`,
// });
// // Set this info to be able to see if this field is a real database's field.
// attribute.isVirtual = true;
const ref = getRef(attribute.collection, attribute.plugin);
setField(name, [{ type: ObjectId, ref }]);
break;
}

View File

@ -463,10 +463,8 @@ module.exports = {
return;
}
case 'oneMorphToOne':
case 'oneMorphToMany': {
// TODO: to implement
return;
}
}