Return data source for app.dataSource()

This commit is contained in:
Raymond Feng 2014-07-30 21:57:08 -07:00
parent e5b0e8cd70
commit 1fd562ecbd
1 changed files with 5 additions and 4 deletions

View File

@ -223,13 +223,14 @@ app.models = function () {
*
* @param {String} name The data source name
* @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;
}
/**