Class: ActiveRecord::ConnectionAdapters::ConnectionManagement
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::ConnectionManagement
- Defined in:
- lib/active_record/connection_adapters/abstract/connection_pool.rb
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.
349 350 351 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 349 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
353 354 355 356 357 358 359 360 361 |
# File 'lib/active_record/connection_adapters/abstract/connection_pool.rb', line 353 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") ActiveRecord::Base.clear_active_connections! end end |