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

Use IN operator like Arel for empty hash in where clause #9232

Merged
merged 1 commit into from
Feb 9, 2013

Conversation

robertomiranda
Copy link
Contributor

Change for be more near to the sql generated by Arel, would be easier doing grep in the Rails logs when looking for suspect activity with this patch.

Currently rails is generating something like this

User.where(id: {})
User Load (0.1ms)  SELECT "users".* FROM "users" WHERE (1 = 2)

Arel use '1=0' instead of '1=2' for User.where(id: []) rails/arel@d3a8fa9

guilleiguaran added a commit that referenced this pull request Feb 9, 2013
Use IN operator like Arel for empty hash in where clause
@guilleiguaran guilleiguaran merged commit 1c2b185 into rails:master Feb 9, 2013
@robertomiranda robertomiranda deleted the where-with-empty-hash branch February 9, 2013 17:22
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

Successfully merging this pull request may close these issues.

None yet

2 participants