diff --git a/CHANGELOG.md b/CHANGELOG.md index e5e625a..a04a14f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.3.2 +* Restore `part` directives in generated models. + # 1.3.1 * Add `deploy nginx` and `deploy systemd`. diff --git a/lib/src/commands/make/model.dart b/lib/src/commands/make/model.dart index 010752e..ffefd68 100644 --- a/lib/src/commands/make/model.dart +++ b/lib/src/commands/make/model.dart @@ -72,6 +72,11 @@ class ModelCommand extends Command { deps.add(const MakerDependency('angel_orm', '^1.0.0-alpha')); } + modelLib.body.addAll([ + new Code('part ${rc.snakeCase}.g.dart'), + new Code('part ${rc.snakeCase}.serializer.g.dart'), + ]); + modelLib.body.add(new Class((modelClazz) { modelClazz ..abstract = true @@ -79,7 +84,6 @@ class ModelCommand extends Command { ..extend = refer('Model'); if (needsSerialize) { - // TODO: Add parts // modelLib.addDirective(new PartBuilder('${rc.snakeCase}.g.dart')); modelClazz.annotations.add(refer('serializable')); } diff --git a/pubspec.yaml b/pubspec.yaml index e4bc78a..b1544b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ author: Tobe O description: Command-line tools for the Angel framework. homepage: https://github.com/angel-dart/angel_cli name: angel_cli -version: 1.3.1 +version: 1.3.2 dependencies: analyzer: ">=0.32.0" args: ^1.0.0