Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user signup fails if User struct has pop relationship #83

Open
iateadonut opened this issue Oct 30, 2021 · 3 comments
Open

user signup fails if User struct has pop relationship #83

iateadonut opened this issue Oct 30, 2021 · 3 comments
Assignees
Labels
s: triage Some tests need to be run to confirm the issue

Comments

@iateadonut
Copy link

iateadonut commented Oct 30, 2021

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
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Sep 27, 2022
@sio4 sio4 added s: triage Some tests need to be run to confirm the issue and removed stale labels Sep 27, 2022
@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment. Otherwise, this will be closed in 7 days.

@github-actions github-actions bot added the stale label Oct 28, 2022
@sio4 sio4 removed the stale label Nov 1, 2022
@sio4
Copy link
Member

sio4 commented Feb 6, 2023

Adding has_one itself will not break the workflow of user signup. We need more information for the investigation. If you provide a real example code or fully reproducible steps, I would like to work on it.

@sio4 sio4 self-assigned this Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
s: triage Some tests need to be run to confirm the issue
Projects
None yet
Development

No branches or pull requests

2 participants