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 branching in raw SQL #1008

Closed
JasonBarnabe opened this Issue Feb 22, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@JasonBarnabe
Contributor

JasonBarnabe commented Feb 22, 2017

No warning:

User.connection.execute("SELECT * FROM foo WHERE bar = #{ActiveRecord::Base.connection.quote(true)}")

Warning:

User.connection.execute("SELECT * FROM foo WHERE #{true ? "bar = #{ActiveRecord::Base.connection.quote(true)}" : "bar = 0"}")

presidentbeef added a commit that referenced this issue Feb 23, 2017

@presidentbeef

This comment has been minimized.

Show comment
Hide comment
@presidentbeef

presidentbeef Feb 23, 2017

Owner

Finally an easy one 😜

It's not exactly the conditional, but the nested interpolation, so this fixes a couple other false positives as well.

Owner

presidentbeef commented Feb 23, 2017

Finally an easy one 😜

It's not exactly the conditional, but the nested interpolation, so this fixes a couple other false positives as well.

Repository owner locked and limited conversation to collaborators May 18, 2017

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.