Module: Rollbar::Rails::ControllerMethods

Includes:
Rollbar::RequestDataExtractor
Defined in:
lib/rollbar/plugins/rails/controller_methods.rb

Constant Summary

Constants included from Rollbar::RequestDataExtractor

Rollbar::RequestDataExtractor::ALLOWED_BODY_PARSEABLE_METHODS, Rollbar::RequestDataExtractor::ALLOWED_HEADERS_REGEX

Instance Method Summary collapse

Methods included from Rollbar::RequestDataExtractor

#extract_person_data_from_controller, #extract_request_data_from_rack, #scrub_params, #scrub_url

Instance Method Details

#ratchetio_person_dataObject

for backwards compatabilty with the old ratchetio-gem



46
47
48
# File 'lib/rollbar/plugins/rails/controller_methods.rb', line 46

def ratchetio_person_data
  rollbar_person_data
end

#ratchetio_request_dataObject

for backwards compatabilty with the old ratchetio-gem



51
52
53
# File 'lib/rollbar/plugins/rails/controller_methods.rb', line 51

def ratchetio_request_data
  rollbar_request_data
end

#rollbar_person_dataObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/rollbar/plugins/rails/controller_methods.rb', line 9

def rollbar_person_data
  user = nil
  unless Rollbar::Util.method_in_stack_twice(:rollbar_person_data, __FILE__)
    user = send(Rollbar.configuration.person_method)
  end

  # include id, username, email if non-empty
  if user
    {
      :id => (begin
        user.send(Rollbar.configuration.person_id_method)
      rescue StandardError
        nil
      end),
      :username => (begin
        user.send(Rollbar.configuration.person_username_method)
      rescue StandardError
        nil
      end),
      :email => (begin
        user.send(Rollbar.configuration.person_email_method)
      rescue StandardError
        nil
      end)
    }
  else
    {}
  end
rescue NameError
  {}
end

#rollbar_request_dataObject



41
42
43
# File 'lib/rollbar/plugins/rails/controller_methods.rb', line 41

def rollbar_request_data
  extract_request_data_from_rack(request.env)
end