diff --git a/lib/application.js b/lib/application.js index 9943f0a9..16289bca 100644 --- a/lib/application.js +++ b/lib/application.js @@ -222,14 +222,15 @@ app.models = function () { * Define a DataSource. * * @param {String} name The data source name - * @param {Object} config The data source config + * @param {Object} config The data source config + * @param {DataSource} The registered data source */ - app.dataSource = function (name, config) { + var ds = dataSourcesFromConfig(config, this.connectors); this.dataSources[name] = this.dataSources[classify(name)] = - this.dataSources[camelize(name)] = - dataSourcesFromConfig(config, this.connectors); + this.dataSources[camelize(name)] = ds; + return ds; } /**