Fix ToManyRemoveOp

- This would generate a bad query when run, also the test was failing
  for this same reason and once enabled it was trivial to fix.
This commit is contained in:
Aaron L 2017-01-24 22:45:20 -08:00
parent bdb0ef1b7c
commit 936df65ebc

View file

@ -253,6 +253,9 @@ func (o *{{$txt.LocalTable.NameGo}}) Remove{{$txt.Function.Name}}(exec boil.Exec
strmangle.Placeholders(dialect.IndexPlaceholders, len(related), 2, 1),
)
values := []interface{}{{"{"}}o.{{$txt.LocalTable.ColumnNameGo}}}
for _, rel := range related {
values = append(values, rel.{{$txt.ForeignTable.ColumnNameGo}})
}
if boil.DebugMode {
fmt.Fprintln(boil.DebugWriter, query)