diff --git a/app/models/devise_token_auth/concerns/user.rb b/app/models/devise_token_auth/concerns/user.rb
index <HASH>..<HASH> 100644
--- a/app/models/devise_token_auth/concerns/user.rb
+++ b/app/models/devise_token_auth/concerns/user.rb
@@ -99,11 +99,7 @@ module DeviseTokenAuth::Concerns::User
     end
 
     def database_exists?
-      ActiveRecord::Base.connection
-    rescue ActiveRecord::NoDatabaseError
-      false
-    else
-      true
+      ActiveRecord::Base.connection_pool.with_connection { |con| con.active? } rescue false
     end
   end
Better implementation to test if connection to db is active