mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
62e05ce96f
Currently the database selector middleware only passes the request to the context. This is enough for the resolver to decide whether to switch to the primary, but for a custom resolver and a custom context class, it's not enough to persist any information for subsequent requests. For example, say you want to use a cookie to decide whether when to switch. It's not possible to set the response cookie from this middleware, since neither the context nor the resolver have access to it. This includes an extra step to update the context after the response has been computed. |
||
---|---|---|
.. | ||
database_selector | ||
database_selector.rb |