Check ActiveSupport::Concern is used with scope_to
What does this MR do and why?
This MR adds a new Cop to check EE batched background migrations appropriately extend ActiveSupport::Concern
when scope_to
is used. Resolves #376397 (closed).
When an EE batched background migration uses scope_to
helper, the migration must extend ActiveSupport::Concern
as documented in https://docs.gitlab.com/ee/development/database/batched_background_migrations.html#additional-filters:
NOTE: For EE migrations that define
scope_to
, ensure the module extendsActiveSupport::Concern
.Otherwise, records are processed without taking the scope into consideration.
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 euko