Skip to content

Commit

Permalink
Fix enum generation
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondl committed Nov 17, 2021
1 parent 5b2e255 commit 3ee2df7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Expand Up @@ -4,6 +4,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic
Versioning](http://semver.org/spec/v2.0.0.html).

## [v4.8.2] - 2021-11-16

### Fixed

- Fix regression in enum name generation

## [v4.8.1] - 2021-11-14

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion main.go
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/volatiletech/sqlboiler/v4/importers"
)

const sqlBoilerVersion = "4.8.1"
const sqlBoilerVersion = "4.8.2"

var (
flagConfigFile string
Expand Down
4 changes: 2 additions & 2 deletions templates/main/singleton/boil_types.go.tpl
Expand Up @@ -88,7 +88,7 @@ It only titlecases the EnumValue portion if it's snake-cased.
{{- $valStripped := stripWhitespace $val -}}
{{- $enumValue := $valStripped -}}
{{- if shouldTitleCaseEnum $valStripped -}}
{{$enumValue := titleCase $valStripped}}
{{$enumValue = titleCase $valStripped}}
{{end -}}
{{$enumName}}{{$enumValue}} {{if $.AddEnumTypes}}{{$enumName}}{{end}} = "{{$val}}"
{{end -}}
Expand All @@ -110,7 +110,7 @@ It only titlecases the EnumValue portion if it's snake-cased.
{{- $valStripped := stripWhitespace $val -}}
{{- $enumValue := $valStripped -}}
{{- if shouldTitleCaseEnum $valStripped -}}
{{- $enumValue := titleCase $valStripped -}}
{{- $enumValue = titleCase $valStripped -}}
{{- end -}}

{{- $enumValues = printf "%s%s%s" $enumValues $enumName $enumValue -}}
Expand Down

0 comments on commit 3ee2df7

Please sign in to comment.