Files
lib/src/orm/model/scope/ActiveScope.ts
garrettmills 0a9dd30909
All checks were successful
continuous-integration/drone/push Build is passing
Implement scopes on models and support interacting with them via ModelBuilder
2021-11-11 16:42:37 -06:00

12 lines
295 B
TypeScript

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)
}
}