To export table data from current db connection to CSV
Table from the default db table is exported.
Forest Liana 6.3.1
We have a rails 6 app, with a mutli db (horizontal sharding) setup.
We have implemented a smart action so the end user can select which db they want to connect to.
Then an around_action callback is performed by overriding ForestLiana::BaseController.
The action has code analogous to:
ActiveRecord::Base.connected_to(role: :writing, shard: shard) do yield end
This works well, and ensures the controller action is executed in the context of the correct db connection.
However, when exporting the table data to csv, the default db connection is always used.
Can someone provide insight into this behaviour?