Deprecation warning for `env` while running specs
Summary
You get the following warning while running specs locally.
DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.1 (called from failed_login? at /path/to/gdk/gdk-ce/gitlab/app/controllers/sessions_controller.rb:107)
Possible fixes
Maybe use request.env instead of env in app/controllers/sessions_controller.rb according to this.
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,