Fix prototype access issue with model scopes property
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
d245d15ad6
commit
50e0cf3090
@ -194,7 +194,15 @@ export abstract class Model<T extends Model<T>> extends AppClass implements Bus
|
||||
}
|
||||
}
|
||||
|
||||
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<Model<any>>(this)
|
||||
builder.withScopes(inst.scopes)
|
||||
}
|
||||
|
||||
|
||||
return builder
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user