Sha256: 2f9c70e5d4c2c4234759d1c80a66bc463cf2bd7a31c6342c287e5ee88fa3b645
Contents?: true
Size: 511 Bytes
Versions: 15
Compression:
Stored size: 511 Bytes
Contents
module FreshConnection module Rack class ConnectionManagement def initialize(app) @app = app end def call(env) testing = env['rack.test'] response = @app.call(env) response[2] = ::Rack::BodyProxy.new(response[2]) do ActiveRecord::Base.slave_connection_put_aside! unless testing end response rescue Exception ActiveRecord::Base.slave_connection_put_aside! unless testing raise end end end end
Version data entries
15 entries across 15 versions & 1 rubygems