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

Bind parameters in where_object, where_object_changes #697

Merged
merged 3 commits into from Jan 18, 2016

Conversation

jaredbeck
Copy link
Member

Fixes #696

I don't have a lot of experience using postgres' json and jsonb through activerecord, but it looks like one can use placeholders, e.g.

User.where('preferences @> ?', {newsletter: true}.to_json)

So, I tried to replace string interpolation with placeholders, and it seems to fix #696

@jaredbeck
Copy link
Member Author

Note to self: I found "Using PostgreSQL and jsonb with Ruby on Rails" by Nando Vieira helpful while working on this.

jaredbeck added a commit that referenced this pull request Jan 18, 2016
Bind parameters in where_object, where_object_changes
@jaredbeck jaredbeck merged commit 3420c86 into master Jan 18, 2016
@jaredbeck jaredbeck deleted the fix_issue_696_sqli branch January 18, 2016 20:29
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

1 participant