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...
2 parents fd97266 + 4dacac3 commit c56ef677058de800fbdd16affaf00af10832d69c @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
@@ -457,7 +457,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 c56ef67

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