Refactor #34005
Updated by Ondřej Ezr almost 3 years ago
We require middlewares by `require_dependency`. -This is not exactly correct. I found a nice explanation about this https://ieftimov.com/post/writing-rails-middleware/- https://ieftimov.com/post/writing-rails-middleware/ -So So we should put the middlewares in lib/middleware/foreman instead of lib/foreman/middleware and use Foreman::NameOfMiddleware and use- use -config.middleware.use "Foreman::NameOfMiddleware"- -That config.middleware.use "Foreman::NameOfMiddleware" That way Rails will do it's magic and require the middlewares for us no need to do this explicitly.- We should just use regular require and be done with it, as a conclusion of the https://github.com/rails/rails/issues/25525 suggests.