generathor-laravel 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -34,7 +34,9 @@ class Controller extends base_1.BaseTransformer {
|
|
|
34
34
|
const queryRelations = [];
|
|
35
35
|
for (const relation of item.relations) {
|
|
36
36
|
const label = naming_1.default.relationLabel(relation, item.table);
|
|
37
|
-
|
|
37
|
+
if (relation.type !== 'has-many') {
|
|
38
|
+
queryRelations.push(naming_1.default.relationAttribute(relation, item.table));
|
|
39
|
+
}
|
|
38
40
|
const capitalizedRelationAttribute = naming_1.default.capitalizedRelationAttribute(relation, item.table);
|
|
39
41
|
const relationContext = naming_1.default.relationContext(relation, item.table);
|
|
40
42
|
const relationModel = naming_1.default.modelClass(relation.on.table);
|
|
@@ -151,6 +153,9 @@ class Controller extends base_1.BaseTransformer {
|
|
|
151
153
|
const queryRelations = [];
|
|
152
154
|
const relatedItem = itemsByTable[currentRelation.on.table];
|
|
153
155
|
for (const relation of relatedItem.relations) {
|
|
156
|
+
if (relation.type === 'has-many') {
|
|
157
|
+
continue;
|
|
158
|
+
}
|
|
154
159
|
if (relation.on.table === item.table &&
|
|
155
160
|
relation.columns[0] === currentRelation.references[0]) {
|
|
156
161
|
continue;
|