diff --git a/lib/abstract-class.js b/lib/abstract-class.js index 9b2d2b42..ed256d38 100644 --- a/lib/abstract-class.js +++ b/lib/abstract-class.js @@ -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) {