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

EagerPreload not loading same associations as Eager #547

Closed
reggieriser opened this issue May 11, 2020 · 2 comments
Closed

EagerPreload not loading same associations as Eager #547

reggieriser opened this issue May 11, 2020 · 2 comments
Labels
bug Something isn't working

Comments

@reggieriser
Copy link
Contributor

Description

In testing out the new EagerPreload functionality, I noticed two scenarios where associations did not appear to be populated with EagerPreload but were populated with Eager:

  1. Fetching a belongs_to association for an optional field when it's represented as a pointer (if represented as one of the nulls types, it works fine).
  2. Fetching more than one nested belongs_to association at the same level results in only the last one being populated.

Steps to Reproduce the Problem

Here's an example query and the relevant part of the model.

The first problem noted above seems to be triggered by the pointer UUID fields. After I changed those to nulls.UUID that problem went away, but the second problem above emerged.

Expected Behavior

I expected EagerPreload would result in the same associations being loaded as Eager.

Actual Behavior

Some associations did not appear to load.

Info

Mac OS X Catalina, Postgres, latest Pop development branch, and not using through Buffalo.

@JustGAST
Copy link

Excuse me for intrusion into your issue, but I can add, that EagerPreload not loading many-to-many relations. Killed one day to find it out. Ended with creating new project with Users and Addresses models from documentation and it worked. But not when I switched to EagerPreload mode.

Mac OS X Mojave and MySQL. Using through Buffalo.

@aeneasr
Copy link
Member

aeneasr commented Jan 5, 2021

#602 is merged

@aeneasr aeneasr closed this as completed Jan 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants