Sha256: 20046b91a0071d573084ceae5f354f6d4e373a5fb1b44223efa91a6e1336abde

Contents?: true

Size: 460 Bytes

Versions: 1

Compression:

Stored size: 460 Bytes

Contents

module Metova
  module Logger
    module ControllerPatch
      def append_info_to_payload(payload)
        super
        payload[:ip] = request.remote_ip
        if defined?(current_user) && current_user
          payload[:user] = [
            (current_user.try(:email) || 'NO_EMAIL'),
            (current_user.try(:id) || 'NO_ID')
          ].join('/')
        end
      end
    end
  end
end

ActionController::Base.include Metova::Logger::ControllerPatch

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
metova-logger-0.1.0 lib/metova/logger/controller_patch.rb