Added code to allow model-config to respect model-config.local.js and model-config.env.js as do other config files.
This commit is contained in:
parent
4f6e768426
commit
41af081c55
|
@ -32,7 +32,8 @@ ConfigLoader.loadDataSources = function(rootDir, env) {
|
|||
*/
|
||||
ConfigLoader.loadModels = function(rootDir, env) {
|
||||
/*jshint unused:false */
|
||||
return tryReadJsonConfig(rootDir, 'model-config') || {};
|
||||
//return tryReadJsonConfig(rootDir, 'model-config') || {};
|
||||
return loadNamed(rootDir, env, 'model-config', mergeModelConfig);
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -148,6 +149,15 @@ function mergeDataSourceConfig(target, config, fileName) {
|
|||
}
|
||||
}
|
||||
|
||||
function mergeModelConfig(target, config, fileName) {
|
||||
for (var mc in target) {
|
||||
var err = mergeObjects(target[mc], config[mc]);
|
||||
if (err) {
|
||||
throw new Error('Cannot apply ' + fileName + ' to `' + mc + '`: ' + err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function mergeAppConfig(target, config, fileName) {
|
||||
var err = mergeObjects(target, config);
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in New Issue