diff --git a/lib/registry.js b/lib/registry.js index 311d0b08..0945af7d 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -13,6 +13,7 @@ var DataSource = require('loopback-datasource-juggler').DataSource; var registry = module.exports; +registry.defaultDataSources = {}; /** * Create a named vanilla JavaScript class constructor with an attached @@ -264,8 +265,7 @@ registry.memory = function (name) { */ registry.setDefaultDataSourceForType = function(type, dataSource) { - var defaultDataSources = this.defaultDataSources || - (this.defaultDataSources = {}); + var defaultDataSources = this.defaultDataSources; if(!(dataSource instanceof DataSource)) { dataSource = this.createDataSource(dataSource);