Pass db connection to UnidirectionalCopyTrigger
What does this MR do and why?
Update the UnidirectionalCopyTrigger
class to require an explicit connection argument instead of defaulting to ActiveRecord::Base.connection
. This change is prompted by work towards database decomposition, where we can't rely on ActiveRecord::Base
directly as we have multiple base classes with different connections to different databases.
Helper classes like this should instead receive the proper connection from the caller, which has the context to know which database needs to perform the operation. In this case we were already passing the connection from the migration helpers which use it, but we have a number of migrations calling it directly as well.
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.