Skip to content

Commit 19ddd92

Browse files
committed
fixup! simplify handling of model settings
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
1 parent f78a458 commit 19ddd92

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/cli/generators/import-model/migrate-model.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ function importModelDefinition(modelCtor, log) {
107107

108108
// FIXME: parse LB3 "strict" setting
109109
templateData.allowAdditionalProperties = true;
110-
templateData.modelSettings = stringifyModelSettings(
111-
// FIXME: load model settings from top-level entries and `.options` prop
112-
templateData.settings || {},
113-
);
110+
111+
templateData.modelSettings = stringifyModelSettings(templateData.settings);
114112
return templateData;
115113
}

packages/cli/lib/utils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,7 @@ exports.dataSourceToJSONFileName = function(dataSourceClass) {
564564
};
565565

566566
exports.stringifyModelSettings = function(modelSettings) {
567+
if (!modelSettings || !Object.keys(modelSettings).length) return '';
567568
return stringifyObject(
568569
{settings: modelSettings},
569570
{

0 commit comments

Comments
 (0)