summaryrefslogtreecommitdiff
path: root/vendor/github.com/uptrace/bun/model_table_has_many.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/uptrace/bun/model_table_has_many.go')
-rw-r--r--vendor/github.com/uptrace/bun/model_table_has_many.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/vendor/github.com/uptrace/bun/model_table_has_many.go b/vendor/github.com/uptrace/bun/model_table_has_many.go
index 4db3ec121..3d8a5da6f 100644
--- a/vendor/github.com/uptrace/bun/model_table_has_many.go
+++ b/vendor/github.com/uptrace/bun/model_table_has_many.go
@@ -83,9 +83,9 @@ func (m *hasManyModel) Scan(src interface{}) error {
column := m.columns[m.scanIndex]
m.scanIndex++
- field, err := m.table.Field(column)
- if err != nil {
- return err
+ field := m.table.LookupField(column)
+ if field == nil {
+ return fmt.Errorf("bun: %s does not have column %q", m.table.TypeName, column)
}
if err := field.ScanValue(m.strct, src); err != nil {