From 712478a50c23ad892caf5e47ec27c529a03f334d Mon Sep 17 00:00:00 2001 From: Ritchie Martori Date: Mon, 29 Sep 2014 13:05:31 -0700 Subject: [PATCH] Add Model.disableRemoteMethod() --- lib/models/model.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/models/model.js b/lib/models/model.js index c2fa8715..af5581fa 100644 --- a/lib/models/model.js +++ b/lib/models/model.js @@ -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';