You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Rails 6 multiple database support, the GET request attempts to use the reader role which then fails. Thinking about what the cleanest approach to wrapping opt_out(options) inside of a ActiveRecord::Base.connected_to(role: :writing) block. Right now i'm just monkey patching the controller action.
Another approach could be customizing the resolver to exclude Mailkick paths.
The automatic connection switching feature is opt-in and pretty basic right now (by design), so I don't think it make sense to add official support for it.
This is because calling around_action inline does not make yield available.
The Rails docs explain that using around_action directly this way gives a controller and an action argument to the block. We can use the action block to yield.
https://edgeguides.rubyonrails.org/active_record_multiple_databases.html#using-manual-connection-switching
Using Rails 6 multiple database support, the GET request attempts to use the reader role which then fails. Thinking about what the cleanest approach to wrapping
opt_out(options)
inside of aActiveRecord::Base.connected_to(role: :writing)
block. Right now i'm just monkey patching the controller action.Similar issues in other gems heartcombo/devise#5133
The text was updated successfully, but these errors were encountered: