summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-10-26 18:51:22 +0200
committerJasper Maes <jaspermaes.jm@gmail.com>2018-11-15 08:12:24 +0100
commit616fbd028c05667f7094e38c81c5db3db379cc1e (patch)
treeecc0eddebdc0c6e918806b9455403c423eeb5afe
parent64c35c74f9e878226112897e7c67268358353bc7 (diff)
downloadgitlab-ce-616fbd028c05667f7094e38c81c5db3db379cc1e.tar.gz
Rails5: env is deprecated and will be removed from Rails 5.1
-rw-r--r--app/controllers/application_controller.rb2
-rw-r--r--app/controllers/sessions_controller.rb2
-rw-r--r--changelogs/unreleased/rails5-env-deprecated.yml5
3 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 7f4aa8244ac..5f30154df38 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -163,7 +163,7 @@ class ApplicationController < ActionController::Base
def log_exception(exception)
Raven.capture_exception(exception) if sentry_enabled?
- backtrace_cleaner = Gitlab.rails5? ? env["action_dispatch.backtrace_cleaner"] : env
+ backtrace_cleaner = Gitlab.rails5? ? request.env["action_dispatch.backtrace_cleaner"] : env
application_trace = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, exception).application_trace
application_trace.map! { |t| " #{t}\n" }
logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 643eb75c83c..4bd7d71e264 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -104,7 +104,7 @@ class SessionsController < Devise::SessionsController
end
def failed_login?
- (options = env["warden.options"]) && options[:action] == "unauthenticated"
+ (options = request.env["warden.options"]) && options[:action] == "unauthenticated"
end
# Handle an "initial setup" state, where there's only one user, it's an admin,
diff --git a/changelogs/unreleased/rails5-env-deprecated.yml b/changelogs/unreleased/rails5-env-deprecated.yml
new file mode 100644
index 00000000000..2f8573e2ff6
--- /dev/null
+++ b/changelogs/unreleased/rails5-env-deprecated.yml
@@ -0,0 +1,5 @@
+---
+title: 'Rails5: env is deprecated and will be removed from Rails 5.1'
+merge_request: 22626
+author: Jasper Maes
+type: other