提交 a1c08c12 编写于 作者: S Sean McGivern

Merge branch 'rails5-env-deprecated' into 'master'

Rails5: env is deprecated and will be removed from Rails 5.1

Closes #54384

See merge request gitlab-org/gitlab-ce!22626
...@@ -163,7 +163,7 @@ class ApplicationController < ActionController::Base ...@@ -163,7 +163,7 @@ class ApplicationController < ActionController::Base
def log_exception(exception) def log_exception(exception)
Raven.capture_exception(exception) if sentry_enabled? 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 = ActionDispatch::ExceptionWrapper.new(backtrace_cleaner, exception).application_trace
application_trace.map! { |t| " #{t}\n" } application_trace.map! { |t| " #{t}\n" }
logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}" logger.error "\n#{exception.class.name} (#{exception.message}):\n#{application_trace.join}"
......
...@@ -104,7 +104,7 @@ class SessionsController < Devise::SessionsController ...@@ -104,7 +104,7 @@ class SessionsController < Devise::SessionsController
end end
def failed_login? def failed_login?
(options = env["warden.options"]) && options[:action] == "unauthenticated" (options = request.env["warden.options"]) && options[:action] == "unauthenticated"
end end
# Handle an "initial setup" state, where there's only one user, it's an admin, # Handle an "initial setup" state, where there's only one user, it's an admin,
......
---
title: 'Rails5: env is deprecated and will be removed from Rails 5.1'
merge_request: 22626
author: Jasper Maes
type: other
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册