Class: ActiveRecord::ConnectionAdapters::ConnectionManagement
- Defined in:
- activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb
Defined Under Namespace
Classes: Proxy
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.
470 471 472 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 470 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
474 475 476 477 478 479 480 481 482 483 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 474 def call(env) testing = env.key?('rack.test') status, headers, body = @app.call(env) [status, headers, Proxy.new(body, testing)] rescue ActiveRecord::Base.clear_active_connections! unless testing raise end |