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