diff --git a/src/orm/model/Model.ts b/src/orm/model/Model.ts index 2e36c34..b828a7c 100644 --- a/src/orm/model/Model.ts +++ b/src/orm/model/Model.ts @@ -194,7 +194,15 @@ export abstract class Model> extends AppClass implements Bus } } - builder.withScopes(this.prototype.scopes) + if ( this.prototype.scopes ) { + // Same thing here. Try to get the scopes statically, if possible + builder.withScopes(this.prototype.scopes) + } else if ( this.constructor.length < 1 ) { + // Otherwise, try to instantiate the model if possible and load the scopes that way + const inst = Container.getContainer().make>(this) + builder.withScopes(inst.scopes) + } + return builder }