Permalink
Browse files

use the compile method so we do not have to specify the collectors in…

… this case
  • Loading branch information...
1 parent db5e578 commit a14f746bf0aac3f5e21b8d5b5d9672ba0d1dd979 @tenderlove tenderlove committed Apr 9, 2014
@@ -10,10 +10,9 @@ def initialize
def to_sql(arel, binds = [])
if arel.respond_to?(:ast)
binds = binds.dup
- c = visitor.accept(arel.ast, Arel::Collectors::SQLString.new) do
+ visitor.compile(arel.ast) do
quote(*binds.shift.reverse)
end
- c.value
else
arel
end
@@ -520,10 +520,9 @@ def to_sql
arel = relation.arel
binds = arel.bind_values + relation.bind_values
- c = visitor.accept(arel.ast, Arel::Collectors::SQLString.new) do
+ visitor.compile(arel.ast) do
connection.quote(*binds.shift.reverse)
end
- c.value
end
end

0 comments on commit a14f746

Please sign in to comment.