4 Commits

Author SHA1 Message Date
6fc901b3ec bump version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2021-11-25 17:05:22 -06:00
50e0cf3090 Fix prototype access issue with model scopes property
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-25 17:02:43 -06:00
d245d15ad6 Bump version
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2021-11-25 16:52:35 -06:00
265837b5cd Fix stupid typescript error...
All checks were successful
continuous-integration/drone/push Build is passing
2021-11-25 16:50:01 -06:00
3 changed files with 11 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
{ {
"name": "@extollo/lib", "name": "@extollo/lib",
"version": "0.5.10", "version": "0.5.12",
"description": "The framework library that lifts up your code.", "description": "The framework library that lifts up your code.",
"main": "lib/index.js", "main": "lib/index.js",
"types": "lib/index.d.ts", "types": "lib/index.d.ts",

View File

@@ -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) 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 return builder
} }

View File

@@ -330,7 +330,7 @@ export class AsyncCollection<T> {
await this.each(async (item, index) => { await this.each(async (item, index) => {
const result = await func(item, index) const result = await func(item, index)
if ( typeof result !== 'undefined' ) { if ( typeof result !== 'undefined' ) {
newItems.push(result as NonNullable<T2>) newItems.push(result as unknown as NonNullable<T2>)
} }
}) })