Permalink
Browse files

prevent duplicate errors from being loaded

  • Loading branch information...
tompesman committed Mar 15, 2013
1 parent 7451cbf commit fbb11b77d234c3a08f0034058ebe21f391c88e68
Showing with 6 additions and 3 deletions.
  1. +6 −3 lib/push/daemon/database_reconnectable.rb
@@ -3,9 +3,12 @@ module Daemon
module DatabaseReconnectable
def adaptor_errors
errors = [ActiveRecord::StatementInvalid, ActiveRecord::ConnectionNotEstablished]
- errors << PG::Error if defined?(PG::Error)
- errors << PGError if defined?(PGError)
- errors << Mysql2::Error if defined?(Mysql2)
+ if defined?(::PG::Error)
+ errors << ::PG::Error
+ elsif defined?(::PGError)
+ errors << ::PGError
+ end
+ errors << ::Mysql2::Error if defined?(::Mysql2)
errors
end

0 comments on commit fbb11b7

Please sign in to comment.