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.
466 467 468 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 466 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
470 471 472 473 474 475 476 477 478 479 |
# File 'activerecord/lib/active_record/connection_adapters/abstract/connection_pool.rb', line 470 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 |