aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/visitors
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-08-08 23:23:51 +0100
committerJon Leighton <j@jonathanleighton.com>2011-08-08 23:23:51 +0100
commit79411322ae225289e1c051f4f68ed84c6349e4a0 (patch)
tree424499366dc9c7ced8a271756b86a865ce17c977 /lib/arel/visitors
parent03b6ca269ac8dfec8f70f2b98439d45b873f9e97 (diff)
downloadrails-79411322ae225289e1c051f4f68ed84c6349e4a0.tar.gz
rails-79411322ae225289e1c051f4f68ed84c6349e4a0.tar.bz2
rails-79411322ae225289e1c051f4f68ed84c6349e4a0.zip
Make it the responsibility of the connection to hold on to a visitor for generating SQL, rather than the TreeManager. (There is a related commit coming in Active Record.)
Diffstat (limited to 'lib/arel/visitors')
-rw-r--r--lib/arel/visitors/to_sql.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb
index ec62f4fb89..d424f8602e 100644
--- a/lib/arel/visitors/to_sql.rb
+++ b/lib/arel/visitors/to_sql.rb
@@ -4,17 +4,15 @@ require 'date'
module Arel
module Visitors
class ToSql < Arel::Visitors::Visitor
- def initialize engine
- @engine = engine
+ def initialize pool
+ @pool = pool
@connection = nil
- @pool = nil
@quoted_tables = {}
@quoted_columns = {}
end
def accept object
self.last_column = nil
- @pool = @engine.connection_pool
@pool.with_connection do |conn|
@connection = conn
super