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

fix: preload shouldn't overwrite the value of join #6771

Merged
merged 3 commits into from
Jan 29, 2024

Conversation

black-06
Copy link
Contributor

@black-06 black-06 commented Jan 2, 2024

  • Do only one thing
  • Non breaking API changes
  • Tested

What did this pull request do?

Fix the issue #6715, preload shouldn't overwrite the value of join.

See #6715 (comment)

User Case Description

type (
	Preload struct {
		ID       uint
		Value    string
		NestedID uint
	}
	Join struct {
		ID       uint
		Value    string
		NestedID uint
	}
	Nested struct {
		ID       uint
		Preloads []*Preload
		Join     Join
		ValueID  uint
	}
	Value struct {
		ID     uint
		Name   string
		Nested Nested
	}
)

DB.Joins("Nested").Joins("Nested.Join").Preload("Nested.Preloads").First(&find)

@alexisvisco
Copy link
Contributor

Hello, just to be sure, we are waiting a merge from @jinzhu ?

@black-06
Copy link
Contributor Author

Hello, just to be sure, we are waiting a merge from @jinzhu ?

I think so 😴

@jinzhu jinzhu merged commit 418ee3f into go-gorm:master Jan 29, 2024
34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants