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

false positive when eager loading a single record #3

Open
pcai opened this issue Sep 10, 2023 · 0 comments
Open

false positive when eager loading a single record #3

pcai opened this issue Sep 10, 2023 · 0 comments

Comments

@pcai
Copy link
Owner

pcai commented Sep 10, 2023

safe query raises when eager loading on a resultset using #includes that only has a single related record. this is because activerecord doesnt generate an IN clause, but rather an equals clause. safe query doesnt recognize that the generated query is inherently bounded because the query is matching on a (unique) primary key.

the detection code should ideally figure out if the clause is equality matching on a unique column or pk so it doesnt throw on those queries

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

No branches or pull requests

1 participant