Sha256: 3fad2ad1e28449f5695aa3bdbd956f18ffd16d69983b1370fc2649ea3f280d63

Contents?: true

Size: 834 Bytes

Versions: 51

Compression:

Stored size: 834 Bytes

Contents

module Bugsnag::Middleware
  class Rails3Request
    def initialize(bugsnag)
      @bugsnag = bugsnag
    end
      
    def call(notification)
      if notification.request_data[:rack_env]
        env = notification.request_data[:rack_env]
        params = env["action_dispatch.request.parameters"]

        if params
          # Set the context
          notification.context = "#{params[:controller]}##{params[:action]}"

          # Augment the request tab
          notification.add_tab(:request, {
            :railsAction => "#{params[:controller]}##{params[:action]}",
            :params => params
          })
        end

        # Add the rails version
        notification.add_tab(:environment, {
          :railsVersion => Rails::VERSION::STRING
        })
      end

      @bugsnag.call(notification)
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
bugsnag-2.4.1 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.4.0 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.3.0 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.2.2 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.2.1 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.2.0 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.1.0 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.0.3 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.0.2 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.0.1 lib/bugsnag/middleware/rails3_request.rb
bugsnag-2.0.0 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.8 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.7 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.6 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.5 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.4 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.3 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.2 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.1 lib/bugsnag/middleware/rails3_request.rb
bugsnag-1.8.0 lib/bugsnag/middleware/rails3_request.rb