From 69a59043c8b9a12904795aa9202d7ec519c22733 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Fri, 16 Sep 2016 23:04:58 -0700 Subject: [PATCH] Revert "Fix compare against null.Bytes" This reverts commit bbd9277e0ebc3231d0541abd34c49abd2c0ba290. --- templates/06_relationship_to_one_eager.tpl | 2 +- templates/07_relationship_to_many_eager.tpl | 2 +- templates/08_relationship_to_one_setops.tpl | 2 +- templates_test/relationship_to_many.tpl | 2 +- templates_test/relationship_to_many_setops.tpl | 2 +- templates_test/relationship_to_one.tpl | 2 +- templates_test/relationship_to_one_setops.tpl | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/06_relationship_to_one_eager.tpl b/templates/06_relationship_to_one_eager.tpl index e2069c2..86c3052 100644 --- a/templates/06_relationship_to_one_eager.tpl +++ b/templates/06_relationship_to_one_eager.tpl @@ -6,7 +6,7 @@ {{- $slice := printf "%sSlice" .LocalTable.NameGo -}} {{- $foreignTable := getTable $dot.Tables .ForeignKey.ForeignTable -}} {{- $foreignTableFKeyCol := $foreignTable.GetColumn .ForeignKey.ForeignColumn -}} - {{- $usesBytes := or (eq "[]byte" $foreignTableFKeyCol.Type) (eq "null.Bytes" $foreignTableFKeyCol.Type)}} + {{- $usesBytes := eq "[]byte" $foreignTableFKeyCol.Type}} // Load{{.Function.Name}} allows an eager lookup of values, cached into the // loaded structs of the objects. func ({{$varNameSingular}}L) Load{{.Function.Name}}(e boil.Executor, singular bool, {{$arg}} interface{}) error { diff --git a/templates/07_relationship_to_many_eager.tpl b/templates/07_relationship_to_many_eager.tpl index ec09f3a..053286e 100644 --- a/templates/07_relationship_to_many_eager.tpl +++ b/templates/07_relationship_to_many_eager.tpl @@ -15,7 +15,7 @@ {{- $slice := printf "%sSlice" $txt.LocalTable.NameGo -}} {{- $schemaForeignTable := .ForeignTable | $dot.SchemaTable -}} {{- $fkeyCol := $dot.Table.GetColumn .Column -}} - {{- $usesBytes := or (eq "[]byte" $fkeyCol.Type) (eq "null.Bytes" $fkeyCol.Type)}} + {{- $usesBytes := eq "[]byte" $fkeyCol.Type -}} // Load{{$txt.Function.Name}} allows an eager lookup of values, cached into the // loaded structs of the objects. func ({{$varNameSingular}}L) Load{{$txt.Function.Name}}(e boil.Executor, singular bool, {{$arg}} interface{}) error { diff --git a/templates/08_relationship_to_one_setops.tpl b/templates/08_relationship_to_one_setops.tpl index 93432e5..76832f3 100644 --- a/templates/08_relationship_to_one_setops.tpl +++ b/templates/08_relationship_to_one_setops.tpl @@ -5,7 +5,7 @@ {{- $localNameSingular := .ForeignKey.Table | singular | camelCase -}} {{- $foreignTable := getTable $dot.Tables .ForeignKey.ForeignTable -}} {{- $foreignTableFKeyCol := $foreignTable.GetColumn .ForeignKey.ForeignColumn -}} - {{- $usesBytes := or (eq "[]byte" $foreignTableFKeyCol.Type) (eq "null.Bytes" $foreignTableFKeyCol.Type)}} + {{- $usesBytes := eq "[]byte" $foreignTableFKeyCol.Type -}} // Set{{.Function.Name}} of the {{.ForeignKey.Table | singular}} to the related item. // Sets {{.Function.Receiver}}.R.{{.Function.Name}} to related. // Adds {{.Function.Receiver}} to related.R.{{.Function.ForeignName}}. diff --git a/templates_test/relationship_to_many.tpl b/templates_test/relationship_to_many.tpl index 73c4629..9e386d2 100644 --- a/templates_test/relationship_to_many.tpl +++ b/templates_test/relationship_to_many.tpl @@ -9,7 +9,7 @@ {{- else -}} {{- $rel := textsFromRelationship $dot.Tables $table . -}} {{- $fkeyCol := $dot.Table.GetColumn .Column -}} - {{- $usesBytes := or (eq "[]byte" $fkeyCol.Type) (eq "null.Bytes" $fkeyCol.Type)}} + {{- $usesBytes := eq "[]byte" $fkeyCol.Type}} func test{{$rel.LocalTable.NameGo}}ToMany{{$rel.Function.Name}}(t *testing.T) { var err error tx := MustTx(boil.Begin()) diff --git a/templates_test/relationship_to_many_setops.tpl b/templates_test/relationship_to_many_setops.tpl index 4fbdae5..c02df30 100644 --- a/templates_test/relationship_to_many_setops.tpl +++ b/templates_test/relationship_to_many_setops.tpl @@ -11,7 +11,7 @@ {{- $foreignVarNameSingular := .ForeignTable | singular | camelCase -}} {{- $rel := textsFromRelationship $dot.Tables $table . -}} {{- $fkeyCol := $dot.Table.GetColumn .Column -}} - {{- $usesBytes := or (eq "[]byte" $fkeyCol.Type) (eq "null.Bytes" $fkeyCol.Type)}} + {{- $usesBytes := eq "[]byte" $fkeyCol.Type}} func test{{$rel.LocalTable.NameGo}}ToManyAddOp{{$rel.Function.Name}}(t *testing.T) { var err error diff --git a/templates_test/relationship_to_one.tpl b/templates_test/relationship_to_one.tpl index 391da92..389bca9 100644 --- a/templates_test/relationship_to_one.tpl +++ b/templates_test/relationship_to_one.tpl @@ -3,7 +3,7 @@ {{- with .Rel -}} {{- $foreignTable := getTable $dot.Tables .ForeignKey.ForeignTable -}} {{- $foreignTableFKeyCol := $foreignTable.GetColumn .ForeignKey.ForeignColumn -}} -{{- $usesBytes := or (eq "[]byte" $foreignTableFKeyCol.Type) (eq "null.Bytes" $foreignTableFKeyCol.Type)}} +{{- $usesBytes := eq "[]byte" $foreignTableFKeyCol.Type -}} func test{{.LocalTable.NameGo}}ToOne{{.ForeignTable.NameGo}}_{{.Function.Name}}(t *testing.T) { tx := MustTx(boil.Begin()) defer tx.Rollback() diff --git a/templates_test/relationship_to_one_setops.tpl b/templates_test/relationship_to_one_setops.tpl index 650eb77..b59313e 100644 --- a/templates_test/relationship_to_one_setops.tpl +++ b/templates_test/relationship_to_one_setops.tpl @@ -5,7 +5,7 @@ {{- $foreignVarNameSingular := .ForeignKey.ForeignTable | singular | camelCase -}} {{- $foreignTable := getTable $dot.Tables .ForeignKey.ForeignTable -}} {{- $foreignTableFKeyCol := $foreignTable.GetColumn .ForeignKey.ForeignColumn -}} -{{- $usesBytes := or (eq "[]byte" $foreignTableFKeyCol.Type) (eq "null.Bytes" $foreignTableFKeyCol.Type)}} +{{- $usesBytes := eq "[]byte" $foreignTableFKeyCol.Type -}} func test{{.LocalTable.NameGo}}ToOneSetOp{{.ForeignTable.NameGo}}_{{.Function.Name}}(t *testing.T) { var err error