Skip to content

false positive when eager loading a single record #3

@pcai

Description

@pcai

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions