diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-24 09:28:10 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-24 09:28:10 -0700 |
commit | 7615bd7f928390d0ba9501e5206fd89ce6ce44fc (patch) | |
tree | 7e8396620d43822a943bc5cb532c31e15490cc81 | |
parent | 03724fb1789198cc394f6e8b69cf9404e03eddd7 (diff) | |
download | rails-7615bd7f928390d0ba9501e5206fd89ce6ce44fc.tar.gz rails-7615bd7f928390d0ba9501e5206fd89ce6ce44fc.tar.bz2 rails-7615bd7f928390d0ba9501e5206fd89ce6ce44fc.zip |
using the connection pool while visiting
-rw-r--r-- | lib/arel/tree_manager.rb | 2 | ||||
-rw-r--r-- | lib/arel/visitors/to_sql.rb | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/arel/tree_manager.rb b/lib/arel/tree_manager.rb index 8a13345c91..077458fe18 100644 --- a/lib/arel/tree_manager.rb +++ b/lib/arel/tree_manager.rb @@ -15,7 +15,7 @@ module Arel end def to_sql - visitor.accept @head + @visitor.accept @head end def initialize_copy other diff --git a/lib/arel/visitors/to_sql.rb b/lib/arel/visitors/to_sql.rb index d1cb115238..69c7736a4b 100644 --- a/lib/arel/visitors/to_sql.rb +++ b/lib/arel/visitors/to_sql.rb @@ -9,8 +9,10 @@ module Arel end def accept object - @connection = @engine.connection - visit object + @engine.connection_pool.with_connection do |conn| + @connection = conn + visit object + end end private |