Sha256: b6f4c7c6e2096590341d80078e0d319bae01dc9d8b5f43c84415017a59dba5f5

Contents?: true

Size: 388 Bytes

Versions: 28

Compression:

Stored size: 388 Bytes

Contents

module ActiveRecord::Turntable
  module Rack
    class ConnectionManagement
      def initialize(app)
        @app = app
      end

      def call(env)
        @app.call(env)
      ensure
        unless env.key?("rack.test")
          ActiveRecord::Base.connection_handler.clear_all_connections!
          ActiveRecord::Base.clear_all_connections!
        end
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
activerecord-turntable-2.5.0 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.4.0 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.3.3 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.3.2 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.3.1 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.3.0 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.2.2 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.2.1 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.2.0 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.1 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.0 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.0.rc2 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.0.rc1 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.0.beta2 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.1.0.beta1 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.0.6 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.0.5 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.0.4 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.0.3 lib/active_record/turntable/rack/connection_management.rb
activerecord-turntable-2.0.2 lib/active_record/turntable/rack/connection_management.rb