Added relations to redis ORM

This commit is contained in:
2024-08-13 15:18:47 -04:00
parent 2a5ca3664a
commit b27e1b1617
20 changed files with 240 additions and 150 deletions
+3 -5
View File
@@ -22,10 +22,8 @@ function ModelPs(model){
}
return new Proxy(model, {
construct(target, args) {
let instance = ModelPs(new model(...args));
return instance;
construct(target, args, newTarget) {
return ModelPs(Reflect.construct(target, args, newTarget))
},
get(target, propKey, receiver) {
if(propKey == 'constructor') return target.constructor;
@@ -46,7 +44,7 @@ function ModelPs(model){
}
return res;
}catch(error){
console.log("grrrr")
console.log("grrrr", error)
}
}
} else {