Merge pull request #463 from offlinehacker/master

add count to relations and scopes
This commit is contained in:
Raymond Feng 2014-08-15 13:18:51 -07:00
commit e35bc9ed5f
1 changed files with 7 additions and 0 deletions

View File

@ -503,6 +503,13 @@ Model.scopeRemoting = function(scopeName, scope, define) {
http: {verb: 'delete', path: '/' + pathName},
description: 'Deletes all ' + scopeName + ' of this model.'
});
define('__count__' + scopeName, {
isStatic: isStatic,
http: {verb: 'get', path: '/' + pathName + '/count'},
description: 'Counts ' + scopeName + ' of ' + this.modelName + '.',
returns: {arg: 'count', type: 'number', root: true}
});
};
Model.nestRemoting = function(relationName, options, cb) {