Sha256: bd56767434c5c62daecbd4f0144103b492c5cf9acb8615dba8bbde5096c3cda1

Contents?: true

Size: 680 Bytes

Versions: 2

Compression:

Stored size: 680 Bytes

Contents

module Rollbar
  module Middleware
    module Rails
      # Middleware that ensures any database calls to load data for exception reports
      # are done before connections are cleaned up by the rake connection pool middleware
      class RollbarRequestStore
        def initialize(app)
          @app = app
        end
        
        def call(env)
          begin
            @app.call(env)
          rescue
            controller = env["action_controller.instance"]
            if controller
              env['rollbar.person_data'] = controller.try(Rollbar.configuration.person_method)
            end
            raise
          end
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rollbar-0.11.7 lib/rollbar/middleware/rails/rollbar_request_store.rb
rollbar-0.11.6 lib/rollbar/middleware/rails/rollbar_request_store.rb