Closed biinari closed 10 years ago
Ah yes, this should be addressed. That's the right way to do it, yes. If it's not there we can fall back to the old behavior.
Would you like to work up a patch, or should I?
I'll make a pull request
I guess the original intention was to load after rack but before rails? Works for me if I just replace Rack::MethodOverride
with Rack::Runtime
:
initializer "request_store.insert_middleware" do |app|
app.config.middleware.insert_after Rack::Runtime, RequestStore::Middleware
end
When using rails-api, or any setup where the middleware Rack::MethodOverride is not present, it fails to add the request store middleware.
Would it be reasonable to check whether Rack::MethodOverride is in the middleware list to decide whether to insert after it?