diff options
author | blackst0ne <blackst0ne.ru@gmail.com> | 2018-06-13 14:12:38 +1100 |
---|---|---|
committer | blackst0ne <blackst0ne.ru@gmail.com> | 2018-06-13 14:12:38 +1100 |
commit | 1499b02f73a6d8800a8132ea7b19a7e97fff1b4e (patch) | |
tree | 74c7405c0768455eba210d0035c5c43012413686 /config/application.rb | |
parent | 8eea1a92b51c0d2a7ca1fae20d9d6e70a45bb87a (diff) | |
download | gitlab-ce-1499b02f73a6d8800a8132ea7b19a7e97fff1b4e.tar.gz |
[Rails5] Pass class references instead of strings to middleware builderblackst0ne-rails5-update-middlewares
It fixes Rails 5.0 deprecation flooding like:
```
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"::Gitlab::Middleware::ReadOnly" => Gitlab::Middleware::ReadOnly
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"ActionDispatch::Static" => ActionDispatch::Static
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"Gitlab::Testing::RequestBlockerMiddleware" => Gitlab::Testing::RequestBlockerMiddleware
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"ActionDispatch::Static" => ActionDispatch::Static
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
them to actual class references. For example:
"Gitlab::Testing::RequestInspectorMiddleware" => Gitlab::Testing::RequestInspectorMiddleware
(called from <top (required)> at /builds/gitlab-org/gitlab-ce/config/environment.rb:11)
```
Diffstat (limited to 'config/application.rb')
-rw-r--r-- | config/application.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/config/application.rb b/config/application.rb index d379d611074..95f6d2c9af1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -12,6 +12,7 @@ module Gitlab require_dependency Rails.root.join('lib/gitlab/redis/shared_state') require_dependency Rails.root.join('lib/gitlab/request_context') require_dependency Rails.root.join('lib/gitlab/current_settings') + require_dependency Rails.root.join('lib/gitlab/middleware/read_only') # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers @@ -175,7 +176,7 @@ module Gitlab ENV['GIT_TERMINAL_PROMPT'] = '0' # Gitlab Read-only middleware support - config.middleware.insert_after ActionDispatch::Flash, '::Gitlab::Middleware::ReadOnly' + config.middleware.insert_after ActionDispatch::Flash, ::Gitlab::Middleware::ReadOnly config.generators do |g| g.factory_bot false |