Sha256: c4b114ae58677c566c8eab1eeccab3d9754a7563d60f07baaf89ffeb88a11b73

Contents?: true

Size: 407 Bytes

Versions: 13

Compression:

Stored size: 407 Bytes

Contents

module Wbase
  class ApplicationController < ActionController::Base
    include AuthHelper

    protect_from_forgery with: :exception
    around_action :tag_logs_with_user_id

    def tag_logs_with_user_id
      tag = "user-anonymous"
      if logged_in?
        tag = "user-#{ current_user.id } #{ current_user.email }"
      end
      Rails.logger.tagged(tag) do
        yield
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
wbase-0.1.2 app/controllers/wbase/application_controller.rb
wbase-0.1.0 app/controllers/wbase/application_controller.rb
wbase-0.0.15 app/controllers/wbase/application_controller.rb
wbase-0.0.14 app/controllers/wbase/application_controller.rb
wbase-0.0.13 app/controllers/wbase/application_controller.rb
wbase-0.0.12 app/controllers/wbase/application_controller.rb
wbase-0.0.11 app/controllers/wbase/application_controller.rb
wbase-0.0.10 app/controllers/wbase/application_controller.rb
wbase-0.0.9 app/controllers/wbase/application_controller.rb
wbase-0.0.8 app/controllers/wbase/application_controller.rb
wbase-0.0.7 app/controllers/wbase/application_controller.rb
wbase-0.0.6 app/controllers/wbase/application_controller.rb
wbase-0.0.5 app/controllers/wbase/application_controller.rb