Class: WithConnection::ConnectionManagement
- Inherits:
-
Object
- Object
- WithConnection::ConnectionManagement
- Defined in:
- lib/with_connection/connection_pool.rb
Constant Summary collapse
- @@connection_pools =
[]
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ ConnectionManagement
constructor
A new instance of ConnectionManagement.
Constructor Details
#initialize(app) ⇒ ConnectionManagement
Returns a new instance of ConnectionManagement.
67 68 69 |
# File 'lib/with_connection/connection_pool.rb', line 67 def initialize(app) @app = app end |
Class Method Details
.connection_pools ⇒ Object
63 64 65 |
# File 'lib/with_connection/connection_pool.rb', line 63 def self.connection_pools @@connection_pools end |
Instance Method Details
#call(env) ⇒ Object
71 72 73 74 75 76 77 78 79 |
# File 'lib/with_connection/connection_pool.rb', line 71 def call(env) @app.call(env) ensure # Don't return connection (and perform implicit rollback) if # this request is a part of integration test unless env.key?("rack.test") self.class.connection_pools.each(&:release_connection_with_warning) end end |