Class: Grape::App::Middleware::ConnectionManagement
- Inherits:
-
Object
- Object
- Grape::App::Middleware::ConnectionManagement
- Defined in:
- lib/grape/app/middleware/connection_management.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.
2 3 4 |
# File 'lib/grape/app/middleware/connection_management.rb', line 2 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/grape/app/middleware/connection_management.rb', line 6 def call(env) @app.call(env) rescue ::ActiveRecord::StatementInvalid ::ActiveRecord::Base.clear_active_connections! raise end |