Sha256: e954a5e67775988c52a0ea1608ba950433dd9f8646847bde7f8b10f1b9279ec3

Contents?: true

Size: 1017 Bytes

Versions: 69

Compression:

Stored size: 1017 Bytes

Contents

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

69 entries across 69 versions & 1 rubygems

Version Path
rollbar-1.2.3 lib/rollbar/rails/controller_methods.rb
rollbar-1.2.2 lib/rollbar/rails/controller_methods.rb
rollbar-1.2.1 lib/rollbar/rails/controller_methods.rb
rollbar-1.2.0 lib/rollbar/rails/controller_methods.rb
rollbar-1.1.0 lib/rollbar/rails/controller_methods.rb
rollbar-1.0.1 lib/rollbar/rails/controller_methods.rb
rollbar-1.0.0 lib/rollbar/rails/controller_methods.rb
rollbar-0.13.2 lib/rollbar/rails/controller_methods.rb
rollbar-0.13.1 lib/rollbar/rails/controller_methods.rb
rollbar-0.13.0 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.20 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.19 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.18 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.17 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.16 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.15 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.14 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.13 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.12 lib/rollbar/rails/controller_methods.rb
rollbar-0.12.11 lib/rollbar/rails/controller_methods.rb