Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

respond_to? doesn't work here, but method_defined? will

this bug were causing odd things in postgresql. especially in tests.
  • Loading branch information...
commit 6afea1188664a1124c668f40ce542a5c8e7f2a6a 1 parent 387780f
@ochko ochko authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/after_commit/connection_adapters.rb
View
4 lib/after_commit/connection_adapters.rb
@@ -3,7 +3,7 @@ module ConnectionAdapters
def self.included(base)
base.class_eval do
- if respond_to?(:transaction)
+ if method_defined?(:transaction)
def transaction_with_callback(*args, &block)
# @disable_rollback is set to false at the start of the
# outermost call to #transaction. After committing, it is
@@ -17,7 +17,7 @@ def transaction_with_callback(*args, &block)
end
alias_method_chain :transaction, :callback
- elsif respond_to?(:begin_db_transaction)
+ elsif method_defined?(:begin_db_transaction)
def begin_db_transaction_with_callback(*args, &block)
# @disable_rollback is set to false at the start of the
# outermost call to #transaction. After committing, it is
Please sign in to comment.
Something went wrong with that request. Please try again.