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