From 471a394215e01ffae03bbafa027a44f63e0658b8 Mon Sep 17 00:00:00 2001 From: Nick Sieger Date: Fri, 16 Oct 2009 11:39:32 -0500 Subject: Modify connection pool callbacks to be compatible w/ new style Signed-off-by: Yehuda Katz --- .../connection_adapters/abstract/connection_pool.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'activerecord/lib/active_record/connection_adapters') diff --git a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb index 12253eac3f..377f2a44c5 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb @@ -211,9 +211,10 @@ module ActiveRecord # calling +checkout+ on this pool. def checkin(conn) @connection_mutex.synchronize do - conn.run_callbacks :checkin - @checked_out.delete conn - @queue.signal + conn.run_callbacks :checkin do + @checked_out.delete conn + @queue.signal + end end end @@ -255,9 +256,10 @@ module ActiveRecord end def checkout_and_verify(c) - c.verify! - c.run_callbacks :checkout - @checked_out << c + c.run_callbacks :checkout do + c.verify! + @checked_out << c + end c end end -- cgit v1.2.3