Sha256: 8f9285306c51db4177b11faae1f6e864018ba89d68b5fe2abea3221ad313a439

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

module Radriar
  module Bugsnag
    module UserInfo
      extend ActiveSupport::Concern
      included do
        before do
          ::Bugsnag.before_notify_callbacks << ->(notif) do
            if current_user
              notif.add_tab(:user, {
                id:           current_user.id,
                username:     current_user.username,
                ip:           notif.user_id
              })
            end
          end
        end

        after do
          Bugsnag.before_notify_callbacks.clear
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
radriar-0.1.0.alpha.3 lib/radriar/bugsnag/user_info.rb
radriar-0.1.0.alpha.2 lib/radriar/bugsnag/user_info.rb
radriar-0.1.0.alpha.1 lib/radriar/bugsnag/user_info.rb