Sha256: 6e2ed5279d2641d5b52ff1201e541537718658201f20e74286cd4ab2942c872f
Contents?: true
Size: 515 Bytes
Versions: 11
Compression:
Stored size: 515 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.replica_connection_put_aside! unless testing end response rescue Exception ActiveRecord::Base.replica_connection_put_aside! unless testing raise end end end end
Version data entries
11 entries across 11 versions & 1 rubygems