Skip to content

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)

@black-06 black-06 requested a review from a631807682 January 2, 2024 12:57
@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 😴

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.

5 participants