Comment all the things!

This commit is contained in:
2020-11-08 12:34:50 -06:00
parent 72f3923866
commit 06515b0559
73 changed files with 269 additions and 162 deletions

View File

@@ -1,6 +1,17 @@
const Scope = require('flitter-orm/src/model/Scope')
/**
* This is a model scope which excludes any models without is_active = true.
* In effect, this provides a mechanism for soft-deletes.
*
* @extends Scope
*/
class ActiveScope extends Scope {
/**
* Apply this scope's conditions to a model filter.
* @param to_filter
* @return {Promise<*>}
*/
async filter(to_filter) {
return to_filter.equal('is_active', true)
}