1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record/middleware
Rosa Gutierrez 62e05ce96f Allow updating the database selector context with the response
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.
2020-01-16 19:25:22 +01:00
..
database_selector Allow updating the database selector context with the response 2020-01-16 19:25:22 +01:00
database_selector.rb Allow updating the database selector context with the response 2020-01-16 19:25:22 +01:00