Fix Location pointer

This commit is contained in:
Patrick O'brien 2016-09-01 11:24:39 +10:00
parent 8f6191c4d2
commit d56e28a36d
2 changed files with 4 additions and 22 deletions

View file

@ -10,7 +10,7 @@ var (
currentDB Executor
// timestampLocation is the timezone used for the
// automated setting of created_at/updated_at columns
timestampLocation *time.Location
timestampLocation = time.UTC
)
// DebugMode is a flag controlling whether generated sql statements and

View file

@ -2,13 +2,7 @@
{{- if not .NoAutoTimestamps -}}
{{- $colNames := .Table.Columns | columnNames -}}
{{if containsAny $colNames "created_at" "updated_at"}}
loc := boil.GetLocation()
currTime := time.Time{}
if loc != nil {
currTime = time.Now().In(boil.GetLocation())
} else {
currTime = time.Now()
}
currTime := time.Now().In(boil.GetLocation())
{{range $ind, $col := .Table.Columns}}
{{- if eq $col.Name "created_at" -}}
{{- if $col.Nullable}}
@ -42,13 +36,7 @@
{{- if not .NoAutoTimestamps -}}
{{- $colNames := .Table.Columns | columnNames -}}
{{if containsAny $colNames "updated_at"}}
loc := boil.GetLocation()
currTime := time.Time{}
if loc != nil {
currTime = time.Now().In(boil.GetLocation())
} else {
currTime = time.Now()
}
currTime := time.Now().In(boil.GetLocation())
{{range $ind, $col := .Table.Columns}}
{{- if eq $col.Name "updated_at" -}}
{{- if $col.Nullable}}
@ -66,13 +54,7 @@
{{- if not .NoAutoTimestamps -}}
{{- $colNames := .Table.Columns | columnNames -}}
{{if containsAny $colNames "created_at" "updated_at"}}
loc := boil.GetLocation()
currTime := time.Time{}
if loc != nil {
currTime = time.Now().In(boil.GetLocation())
} else {
currTime = time.Now()
}
currTime := time.Now().In(boil.GetLocation())
{{range $ind, $col := .Table.Columns}}
{{- if eq $col.Name "created_at" -}}
{{- if $col.Nullable}}