Sha256: a6b5e87f72dd5dd2cd08d882b8197c87762e03f22814ba153490f6725d68ad0e

Contents?: true

Size: 449 Bytes

Versions: 1

Compression:

Stored size: 449 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) || 'NOEMAIL'),
            current_user.id
          ].join('/')
        end
      end

    end
  end
end

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

Version data entries

1 entries across 1 versions & 1 rubygems

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