14 lines
332 B
JavaScript
14 lines
332 B
JavaScript
|
const { Scope } = require('flitter-orm')
|
||
|
|
||
|
/**
|
||
|
* A flitter-orm scope that enables soft-deletion by an active key.
|
||
|
* @extends {module:flitter-orm/src/model/Scope~Scope}
|
||
|
*/
|
||
|
class ActiveScope extends Scope {
|
||
|
async filter(to_filter) {
|
||
|
return to_filter.equal('active', true)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = exports = ActiveScope
|