Skip to content

Commit

Permalink
fix: trim suffixes excess
Browse files Browse the repository at this point in the history
  • Loading branch information
toopay committed Sep 8, 2024
1 parent cbf04d1 commit 6243b68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/generator/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func BuildRelationFields(table objects.Table, relations []state.Relation) (mappe
}

if r.JoinRelation != nil {
throughSuffix := fmt.Sprintf("%s_%s", r.Through, strings.Replace(r.JoinsSourceForeignKey, "_id", "", -1)))
throughSuffix := fmt.Sprintf("%s_%s", r.Through, strings.Replace(r.JoinsSourceForeignKey, "_id", "", -1))
r.Table = fmt.Sprintf("%sThrough%s", inflection.Plural(r.Table), utils.SnakeCaseToPascalCase(inflection.Singular(throughSuffix)))
}

Expand Down

0 comments on commit 6243b68

Please sign in to comment.