diff --git a/lib/registry.js b/lib/registry.js index f0aa85ce..371cdf70 100644 --- a/lib/registry.js +++ b/lib/registry.js @@ -236,7 +236,7 @@ Registry.prototype.configureModel = function(ModelCtor, config) { ModelCtor.attachTo(config.dataSource); debug('Attached model `%s` to dataSource `%s`', modelName, config.dataSource.name); - } else if (config.dataSource === null) { + } else if (config.dataSource === null || config.dataSource === false) { debug('Model `%s` is not attached to any DataSource by configuration.', modelName); } else { diff --git a/test/app.test.js b/test/app.test.js index 0fc38b0c..78870372 100644 --- a/test/app.test.js +++ b/test/app.test.js @@ -604,6 +604,10 @@ describe('app', function() { app.model('MyTestModel', { dataSource: null }); }); + it('accepts false dataSource', function() { + app.model('MyTestModel', { dataSource: false }); + }); + it('should not require dataSource', function() { app.model('MyTestModel', {}); }); diff --git a/test/loopback.test.js b/test/loopback.test.js index c406fa3e..95a54030 100644 --- a/test/loopback.test.js +++ b/test/loopback.test.js @@ -310,7 +310,7 @@ describe('loopback', function() { }); loopback.configureModel(model, { - dataSource: null, + dataSource: false, relations: { owner: { model: 'Application'