Skip to content

user signup fails if User struct has pop relationship #83

@iateadonut

Description

@iateadonut

Just like the title says, let's say you have a user struct, and add a pop relationship (in this case from model SmartcarToken):

type User struct {
	ID           uuid.UUID `json:"id" db:"id"`
	CreatedAt    time.Time `json:"created_at" db:"created_at"`
	UpdatedAt    time.Time `json:"updated_at" db:"updated_at"`
	Email        string    `json:"email" db:"email"`
	PasswordHash string    `json:"password_hash" db:"password_hash"`

	SmartcarToken SmartcarToken `has_one:"smartcar_tokens" fk_id:"user_id"`

	Password             string `json:"-" db:"-"`
	PasswordConfirmation string `json:"-" db:"-"`
}

you get this error:

reflect: call of reflect.Value.Interface on zero Value

Metadata

Metadata

Assignees

Labels

s: triageSome tests need to be run to confirm the issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions