Skip to content

Commit

Permalink
updated rel type sync
Browse files Browse the repository at this point in the history
  • Loading branch information
adranwit committed Sep 6, 2024
1 parent 90f1e06 commit 20ef3a9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions view/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -561,10 +561,12 @@ func (v *View) updateRelationSchemaIfDefined(compType reflect.Type, rel *Relatio
return
}
aView := &rel.Of.View
field, ok := compType.FieldByName(rel.Holder)
if aView.Schema.Type() != nil {
return nil
if aView.Schema.IsNamed() || !ok {
return nil
}
}
field, ok := compType.FieldByName(rel.Holder)
if !ok {
return fmt.Errorf("invalid view '%v' relation '%v' ,failed to locate rel holder: %s, in onwer type: %s", v.Name, rel.Name, rel.Holder, compType.String())
}
Expand Down

0 comments on commit 20ef3a9

Please sign in to comment.