Created
May 23, 2016 09:52
-
-
Save yuroyoro/a22b977a1f5de495f2610abc81e5b5f5 to your computer and use it in GitHub Desktop.
Arel::SelectManager#where_sql が bind_valuesを展開しないのは実装さぼってるだけだと思うの
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Arel | |
class SelectManager | |
def where_sql_with_bind_values | |
return if @ctx.wheres.empty? | |
viz = Visitors::WhereSql.new @engine.connection | |
binds = bind_values.dup | |
binds.map! { |bv| @engine.connection.quote(*bv.reverse) } | |
collect = viz.accept(@ctx, Arel::Collectors::Bind.new) | |
collect.substitute_binds(binds).join | |
collect.substitute_binds(binds).join | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment