{"action":"closed","issue":{"url":"https://api.github.com/repos/krakenjs/kraken-js/issues/484","repository_url":"https://api.github.com/repos/krakenjs/kraken-js","labels_url":"https://api.github.com/repos/krakenjs/kraken-js/issues/484/labels{/name}","comments_url":"https://api.github.com/repos/krakenjs/kraken-js/issues/484/comments","events_url":"https://api.github.com/repos/krakenjs/kraken-js/issues/484/events","html_url":"https://github.com/krakenjs/kraken-js/issues/484","id":215397066,"number":484,"title":"global vars not available in models folder","user":{"login":"mateioprea","id":1246733,"avatar_url":"https://avatars2.githubusercontent.com/u/1246733?v=3","gravatar_id":"","url":"https://api.github.com/users/mateioprea","html_url":"https://github.com/mateioprea","followers_url":"https://api.github.com/users/mateioprea/followers","following_url":"https://api.github.com/users/mateioprea/following{/other_user}","gists_url":"https://api.github.com/users/mateioprea/gists{/gist_id}","starred_url":"https://api.github.com/users/mateioprea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mateioprea/subscriptions","organizations_url":"https://api.github.com/users/mateioprea/orgs","repos_url":"https://api.github.com/users/mateioprea/repos","events_url":"https://api.github.com/users/mateioprea/events{/privacy}","received_events_url":"https://api.github.com/users/mateioprea/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-03-20T11:49:17Z","updated_at":"2017-03-21T14:41:29Z","closed_at":"2017-03-21T14:41:29Z","body":"Hello, \r\n\r\nI'm having an issue with global variables in models folder. I'm trying to do the following\r\n\r\n```\r\nonconfig: function (config, next) {\r\nglobal.dbModel = require('knex')({\r\n            client: 'mysql',\r\n            connection: config.get('rs')\r\n        });\r\n});\r\n``` \r\n\r\nThen, I have my user model in /models folder which requires('../lib/bookshelf') that is supposed to be configured with that global.dbModel variable. But my global.dbModel is not available anywhere, in the files. Is this a bug? I see an example [here](https://github.com/krakenjs/kraken-js/issues/408) and it's kind of what I'm trying to do.\r\n\r\nMy question is: how do I get to see that global.dbModel in my /lib or /model folder? "}}
{"actor":{"display_login":"mateioprea"}}