From 0ba78296047874debd33ce62588e97c371b7138c Mon Sep 17 00:00:00 2001 From: Scott Gress Date: Thu, 11 Feb 2016 00:53:38 -0600 Subject: [PATCH] Expose the `loadAndRegisterControllers` method for now. `loadAndRegisterControllers` used to be defined directly on the hook object, but was removed when it was moved to a different file. A couple of apps in the wild are relying on it, so we'll re-introduce it for now, but it really needs to be wrapped in a public `.reload()` method. --- lib/hooks/controllers/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/hooks/controllers/index.js b/lib/hooks/controllers/index.js index 3fe8b97059..bf85e3dbe9 100644 --- a/lib/hooks/controllers/index.js +++ b/lib/hooks/controllers/index.js @@ -52,8 +52,11 @@ module.exports = function(sails) { sails.on('route:typeUnknown', interpretRouteSyntax); // Load controllers from app and register their actions as middleware. - var loadAndRegisterControllers = toLoadAndRegisterControllers(sails, this); - loadAndRegisterControllers(cb); + // TODO -- make a public .reload() hook method, rather than exposing + // this private method on the hook object. Doing this for now because + // certain apps in the wild are relying on it. + this.loadAndRegisterControllers = toLoadAndRegisterControllers(sails, this); + this.loadAndRegisterControllers(cb); },