From b5c47dc7a5b09816efa46f7b06f83b04dfc0155d Mon Sep 17 00:00:00 2001 From: crandmck Date: Fri, 11 Jul 2014 15:41:14 -0700 Subject: [PATCH] Split out aliases for deleteById and destroyAll functions for jsdoc. --- lib/models/data-model.js | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/models/data-model.js b/lib/models/data-model.js index 66060e2f..416f8561 100644 --- a/lib/models/data-model.js +++ b/lib/models/data-model.js @@ -221,24 +221,42 @@ setRemoting(DataModel.findOne, { * @param {Function} [cb] - callback called with (err) */ -DataModel.remove = -DataModel.deleteAll = DataModel.destroyAll = function destroyAll(where, cb) { throwNotAttached(this.modelName, 'destroyAll'); }; +/** + * Alias for `destroyAll` + */ + +DataModel.remove = DataModel.destroyAll; + +/** + * Alias for `destroyAll` + */ +DataModel.deleteAll = DataModel.destroyAll; + + /** * Destroy a record by id * @param {*} id The id value * @param {Function} cb - callback called with (err) */ -DataModel.removeById = -DataModel.deleteById = DataModel.destroyById = function deleteById(id, cb) { throwNotAttached(this.modelName, 'deleteById'); }; +/** + * Alias for deleteById + */ +DataModel.deleteById = DataModel.destroyById; + +/** + * Alias for deleteById + */ +DataModel.removeById = DataModel.destroyById; + // deleteById ~ remoting attributes setRemoting(DataModel.deleteById, { description: 'Delete a model instance by id from the data source',