add count to relations and scopes

Signed-off-by: Jaka Hudoklin <jakahudoklin@gmail.com>
This commit is contained in:
Jaka Hudoklin 2014-08-12 15:03:15 +02:00
parent 225b2aee50
commit 066e87300d
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) {