Merge pull request #595 from strongloop/feature/disable-remote

Add Model.disableRemoteMethod()
This commit is contained in:
Ritchie Martori 2014-10-01 10:49:41 -07:00
commit 4d2ca3ac94
1 changed files with 13 additions and 0 deletions

View File

@ -380,6 +380,19 @@ Model.remoteMethod = function(name, options) {
this.sharedClass.defineMethod(name, options);
}
/**
* Disable remote invocation for the method with the given name.
*
* @param {String} name The name of the method.
* @param {Boolean} isStatic Is the method static (eg. `MyModel.myMethod`)? Pass
* `false` if the method defined on the prototype (eg.
* `MyModel.prototype.myMethod`).
*/
Model.disableRemoteMethod = function(name, isStatic) {
this.sharedClass.disableMethod(name, isStatic || false);
}
Model.belongsToRemoting = function(relationName, relation, define) {
var modelName = relation.modelTo && relation.modelTo.modelName;
modelName = modelName || 'PersistedModel';