Project

General

Profile

Actions

Refactor #16567

closed

Use constants to register Rails middleware rather than strings

Added by Dominic Cleal over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Rails
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Middleware is currently registered in config/application.rb using a string referring to the class name, but this is deprecated in Rails 5.0:

2016-09-15T14:29:33  [app] [W] DEPRECATION WARNING: Passing strings or symbols to the middleware builder is deprecated, please change
 | them to actual class references.  For example:
 | 
 |   "Middleware::CatchJsonParseErrors" => Middleware::CatchJsonParseErrors
 | 
 |  (called from <top (required)> at /home/dcleal/code/foreman/foreman/config/environment.rb:5)

It will probably be removed in Rails 5.1.

Actions

Also available in: Atom PDF