Merge pull request #463 from offlinehacker/master
add count to relations and scopes
This commit is contained in:
commit
e35bc9ed5f
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue