Refactor #16567

Use constants to register Rails middleware rather than strings

Added by Dominic Cleal 10 months ago. Updated 10 months ago.

Status:Closed
Priority:Low
Assigned To:Dominic Cleal
Category:Rails
Target version:-
Difficulty: Bugzilla link:
Found in release: Pull request:https://github.com/theforeman/foreman/pull/3849
Story points-
Velocity based estimate-
Release1.14.0Release relationshipAuto

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.

Associated revisions

Revision e834c3d4
Added by Dominic Cleal 10 months ago

fixes #16567 - use constants to register Rack middleware

History

#1 Updated by The Foreman Bot 10 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3849 added

#2 Updated by Dominic Cleal 10 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#3 Updated by Dominic Cleal 10 months ago

  • Release set to 1.14.0

Also available in: Atom PDF