Sha256: 04ebe5076d2f1d3b3a7a827f90ae5680f6ab6f3c502b0fb6ed034d326ca99cf8

Contents?: true

Size: 1.03 KB

Versions: 62

Compression:

Stored size: 1.03 KB

Contents

require 'rollbar/request_data_extractor'

module Rollbar
  module Rails
    module ControllerMethods
      include RequestDataExtractor

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

      def rollbar_request_data
        extract_request_data_from_rack(request.env)
      end

      # for backwards compatabilty with the old ratchetio-gem
      def ratchetio_person_data
        rollbar_person_data
      end

      # for backwards compatabilty with the old ratchetio-gem
      def ratchetio_request_data
        rollbar_request_data
      end

    end
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
rollbar-2.14.1 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.14.0 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.13.3 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.13.2 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.13.1 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.13.0 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.12.0 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.5 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.4 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.3 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.2 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.1 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.11.0 lib/rollbar/plugins/rails/controller_methods.rb
rollbar-2.10.0 lib/rollbar/rails/controller_methods.rb
rollbar-2.9.1 lib/rollbar/rails/controller_methods.rb
rollbar-2.9.0 lib/rollbar/rails/controller_methods.rb
rollbar-2.8.3 lib/rollbar/rails/controller_methods.rb
rollbar-2.8.2 lib/rollbar/rails/controller_methods.rb
rollbar-2.8.1 lib/rollbar/rails/controller_methods.rb
rollbar-2.8.0 lib/rollbar/rails/controller_methods.rb