aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/nodes/node.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2014-04-08 12:03:52 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2014-04-08 12:03:52 -0700
commit05b5bb12270b32e094c1c879273e0978dabe5b3b (patch)
tree24a09e4abc6bdb10e62626577e3c024c10707a19 /lib/arel/nodes/node.rb
parentdf52f7ca2ffe1dd4fb8e65db352c7bcaacfea1a5 (diff)
downloadrails-05b5bb12270b32e094c1c879273e0978dabe5b3b.tar.gz
rails-05b5bb12270b32e094c1c879273e0978dabe5b3b.tar.bz2
rails-05b5bb12270b32e094c1c879273e0978dabe5b3b.zip
bind visitor working with collector object
Diffstat (limited to 'lib/arel/nodes/node.rb')
-rw-r--r--lib/arel/nodes/node.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/arel/nodes/node.rb b/lib/arel/nodes/node.rb
index 36e7628612..239c4fd766 100644
--- a/lib/arel/nodes/node.rb
+++ b/lib/arel/nodes/node.rb
@@ -1,3 +1,5 @@
+require 'arel/collectors/sql_string'
+
module Arel
module Nodes
###
@@ -42,7 +44,9 @@ module Arel
#
# Maybe we should just use `Table.engine`? :'(
def to_sql engine = Table.engine
- engine.connection.visitor.accept self
+ collector = Arel::Collectors::SQLString.new
+ collector = engine.connection.visitor.accept self, collector
+ collector.value
end
# Iterate through AST, nodes will be yielded depth-first