Merge pull request #162 from strongloop/feature/fix-deleteById-remoting

Make sure 'deleteById' is used as the remote operation name
This commit is contained in:
Miroslav Bajtoš 2014-07-03 08:22:32 +02:00
commit c92538143a
1 changed files with 4 additions and 1 deletions

View File

@ -897,7 +897,10 @@ DataAccessObject.remove = DataAccessObject.deleteAll = DataAccessObject.destroyA
* @param {Function} cb Callback called with (err)
*/
DataAccessObject.removeById = DataAccessObject.deleteById = DataAccessObject.destroyById = function deleteById(id, cb) {
// [FIXME] rfeng: This is a hack to set up 'deleteById' first so that
// 'deleteById' will be used as the name for strong-remoting to keep it backward
// compatible for angular SDK
DataAccessObject.removeById = DataAccessObject.destroyById = DataAccessObject.deleteById = function deleteById(id, cb) {
if (stillConnecting(this.getDataSource(), this, arguments)) return;
var Model = this;