Skip to content

Commit

Permalink
Update connection pool callbacks for Rails 3
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksieger committed Oct 16, 2009
1 parent 03feb70 commit 2ee0d19
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/active_record/connection_adapters/jdbc_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,13 @@ def quote_table_name(name)

module ConnectionPoolCallbacks
def self.included(base)
base.checkin :on_checkin
base.checkout :on_checkout
if base.respond_to?(:set_callback) # Rails 3 callbacks
base.set_callback :checkin, :after, :on_checkin
base.set_callback :checkout, :before, :on_checkout
else
base.checkin :on_checkin
base.checkout :on_checkout
end
end

def self.needed?
Expand Down

0 comments on commit 2ee0d19

Please sign in to comment.