Implemented destroyAll for sub-scopes
This commit is contained in:
parent
ff65e3a7ad
commit
07edcdce22
|
@ -613,8 +613,17 @@ function defineScope(cls, targetClass, name, params, methods) {
|
|||
this.build(data).save(cb);
|
||||
}
|
||||
|
||||
function destroyAll(id, cb) {
|
||||
// implement me
|
||||
function destroyAll(cb) {
|
||||
targetClass.all(this._scope, function (err, data) {
|
||||
if (err) {
|
||||
cb(err);
|
||||
} else {
|
||||
data.forEach(function (el) {
|
||||
el.destroy();
|
||||
});
|
||||
cb();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function mergeParams(base, update) {
|
||||
|
|
Loading…
Reference in New Issue