File tree Expand file tree Collapse file tree 3 files changed +13
-11
lines changed
integration-tests/relations/lib Expand file tree Collapse file tree 3 files changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,10 @@ class B {
1616
1717 String text;
1818 final cs = ToMany <C >();
19+
20+ @Backlink ()
21+ final as = ToMany <A >();
22+
1923 B (this .text);
2024}
2125
Original file line number Diff line number Diff line change @@ -508,17 +508,14 @@ class CodeChunks {
508508 }
509509 }
510510
511- static String toManyRelations (ModelEntity entity) =>
512- '{' +
513- entity.relations
514- .map ((ModelRelation rel) =>
515- '${relInfo (entity , rel )}: object.${rel .name }' )
516- .join (',' ) +
517- entity.backlinks
518- .map ((ModelBacklink bl) =>
519- '${backlinkRelInfo (entity , bl )}: object.${bl .name }' )
520- .join (',' ) +
521- '}' ;
511+ static String toManyRelations (ModelEntity entity) {
512+ final definitions = < String > [];
513+ definitions.addAll (entity.relations.map (
514+ (ModelRelation rel) => '${relInfo (entity , rel )}: object.${rel .name }' ));
515+ definitions.addAll (entity.backlinks.map ((ModelBacklink bl) =>
516+ '${backlinkRelInfo (entity , bl )}: object.${bl .name }' ));
517+ return '{${definitions .join (',' )}}' ;
518+ }
522519
523520 static String _metaClass (int i, ModelEntity entity) {
524521 final fields = < String > [];
Original file line number Diff line number Diff line change 11## latest
22
33* Add ` Query.findUnique() ` to find a single object matching the query.
4+ * Fix generator when mixing backlinks and "standard" relations in the same entity (generated code had a syntax error).
45
56## 1.1.1 (2021-07-09)
67
You can’t perform that action at this time.
0 commit comments