Merge pull request #371 from strongloop/jsdocs-fix

Split out aliases for deleteById and destroyAll functions for jsdoc.
This commit is contained in:
Rand McKinney 2014-07-14 14:02:34 -07:00
commit a071895723
1 changed files with 22 additions and 4 deletions

View File

@ -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',