to_sql with safe binds #122

bfrog opened this Issue May 23, 2012 · 1 comment


None yet
2 participants

bfrog commented May 23, 2012

Having to do something like

Arel.sql("my_stored_procedure(#{yadda}, #{nada})") is well, a bad thing to do but using Arel by itself
there's no way to use named binds which would be incredibly convenient .

If there is a way to use binds and I don't know about that it what would be great!


tenderlove commented May 23, 2012

You can use the bind param AST node in combination with the named function node.

The problem is that ARel does not know how to query databases, so handing the values for substitution to activerecord is a little bit more tricky.

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