ReplaceTable helper should be passed a connection
What does this MR do and why?
Updates the ReplaceTable
helper to use an externally provided connection, rather than rely on ActiveRecord::Base.connection
directly. This makes the class safe for multiple databases, since it expects to be provided with the appropriate connection.
In practice this class is only used by partitioning migration helpers. The helpers use the connection object directly exposed in a migration, which we will know will be configured to point to the correct database for that particular migration.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Patrick Bair