Fix problematic Database/MultipleDatabases offenses
We have quite a few places where the ActiveRecord::Base.connection
is used. Using the wrong DB connection when executing DB queries can lead to application failures or to data corruption.
Todo:
- Check the rubocop todo file and fix the files under the
Database/MultipleDatabases
rule.- The
ActiveRecord::Base.connection
calls should be turned intoApplicationRecord.connection
orCi::ApplicationRecord.connection
calls.
- The
- Check the rubocop ignore rules in
.rubocop.yml
and adjust them if needed.- We're not running this rule for migration and background migration tests.
Edited by Patrick Bair