diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-08-08 23:23:51 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-08-08 23:23:51 +0100 |
commit | 79411322ae225289e1c051f4f68ed84c6349e4a0 (patch) | |
tree | 424499366dc9c7ced8a271756b86a865ce17c977 /lib/arel/visitors | |
parent | 03b6ca269ac8dfec8f70f2b98439d45b873f9e97 (diff) | |
download | rails-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.rb | 6 |
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 |