Skip to content
Browse files

Merge pull request #6477 from steveklabnik/close_discovered_pg_connec…

…tion

Properly discover a connection is closed in postgresql_adapter
  • Loading branch information...
1 parent 9f1b689 commit b6727a1ed3ca35d4788f52f0bea49952a16cd41e @rafaelfranca rafaelfranca committed May 30, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
View
3 activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -344,7 +344,8 @@ def clear_cache!
# Is this connection alive and ready for queries?
def active?
- @connection.status == PGconn::CONNECTION_OK
+ @connection.query 'SELECT 1'
+ true
rescue PGError
false
end

0 comments on commit b6727a1

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