diff options
Diffstat (limited to 'app/controllers/application_controller.rb')
-rw-r--r-- | app/controllers/application_controller.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 9a7859fc687..5af62576299 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -26,6 +26,7 @@ class ApplicationController < ActionController::Base before_action :require_email, unless: :devise_controller? before_action :set_usage_stats_consent_flag before_action :check_impersonation_availability + before_action :set_unleash_context around_action :set_locale around_action :set_session_storage @@ -533,6 +534,16 @@ class ApplicationController < ActionController::Base yield end end + + private + + def set_unleash_context + @unleash_context = Unleash::Context.new( + session_id: session.id, + remote_address: request.remote_ip, + user_id: session[:user_id] + ) + end end ApplicationController.prepend_if_ee('EE::ApplicationController') |