Remove duplicates from insert whitelist

This commit is contained in:
Patrick O'brien 2016-08-08 16:59:54 +10:00
parent 1c7ad18ab1
commit a073752df2

View file

@ -113,7 +113,7 @@ func (o *{{$tableNameSingular}}) generateInsertColumns(whitelist ...string) ([]s
wl = append(wl, {{$varNameSingular}}ColumnsWithoutDefault...)
wl = append(boil.NonZeroDefaultSet({{$varNameSingular}}ColumnsWithDefault, o), wl...)
wl = boil.SetMerge(boil.NonZeroDefaultSet({{$varNameSingular}}ColumnsWithDefault, o), wl)
wl = boil.SortByKeys({{$varNameSingular}}Columns, wl)
// Only return the columns with default values that are not in the insert whitelist