Skip to content
Browse files

Fix using postgres adapter with postgres-pr after last commit

  • Loading branch information...
1 parent 2a58c45 commit f29cfffde1efc5a9a1bace7e6f274dce10d52fa7 @jeremyevans committed
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/sequel_core/adapters/postgres.rb
View
8 lib/sequel_core/adapters/postgres.rb
@@ -62,6 +62,9 @@ def self.unescape_bytea(obj)
def block(timeout=nil)
end
end
+ unless defined?(CONNECTION_OK)
+ CONNECTION_OK = -1
+ end
end
class PGresult
alias_method :nfields, :num_fields unless method_defined?(:nfields)
@@ -138,9 +141,10 @@ def execute(sql, args=nil)
rescue PGError
raise(Sequel::DatabaseDisconnectError)
end
- (s == Adapter::CONNECTION_OK) ? raise : raise(Sequel::DatabaseDisconnectError)
+ status_ok = (s == Adapter::CONNECTION_OK)
+ status_ok ? raise : raise(Sequel::DatabaseDisconnectError)
ensure
- block if s == Adapter::CONNECTION_OK
+ block if status_ok
end
begin
block_given? ? yield(q) : q.cmd_tuples

0 comments on commit f29cfff

Please sign in to comment.
Something went wrong with that request. Please try again.