Thanks to visit codestin.com
Credit goes to github.com

Skip to content

AfterFind hooks should always be called after all constituents loaded and associated with the parent #3970

@maguro

Description

@maguro

GORM Playground Link

I expect the tests to pass.

go-gorm/playground#255

(Wow, this GORM Playground setup is awesome! 🌮 for all!)

Description

AfterFind hooks should always be called after all constituents loaded and their AfterFind hooks called. In the example above, I have the following hierarchy

ParentDb -> []EntryDb -> []LinksDb

If I load a single instance of EntryDb, the AfterFind hook for EntryDb is called after LinksDb instances are loaded and added to their parent EntryDb. However, if I load ParentDb, the AfterFind hook for EntryDb is called before LinksDb instances are loaded and added to their parent EntryDb.

The link above provides an example. I expected the test to pass. Hopefully, it's something I did wrong.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions