class Raygun::Middleware::RailsInsertAffectedUser
Adapted from the Rollbar approach github.com/rollbar/rollbar-gem/blob/master/lib/rollbar/middleware/rails/rollbar_request_store.rb
Public Class Methods
new(app)
click to toggle source
# File lib/raygun/middleware/rails_insert_affected_user.rb, line 6 def initialize(app) @app = app end
Public Instance Methods
call(env)
click to toggle source
# File lib/raygun/middleware/rails_insert_affected_user.rb, line 10 def call(env) @app.call(env) rescue Exception => exception controller = env["action_controller.instance"] affected_user_method = Raygun.configuration.affected_user_method if controller && controller.respond_to?(affected_user_method, true) user = controller.send(affected_user_method) env["raygun.affected_user"] = Raygun::AffectedUser.information_hash(user) end raise exception end