Implement scopes on models and support interacting with them via ModelBuilder
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-11-11 16:42:37 -06:00
parent d92c8b5409
commit 0a9dd30909
9 changed files with 229 additions and 13 deletions

View File

@@ -0,0 +1,11 @@
import {Scope} from './Scope'
import {AbstractBuilder} from '../../builder/AbstractBuilder'
/**
* A basic scope to limit results where `active` = true.
*/
export class ActiveScope extends Scope {
apply(query: AbstractBuilder<any>): void {
query.where('active', '=', true)
}
}