Class: Gitlab::BackgroundMigration::BackfillDraftStatusOnMergeRequestsWithCorrectedRegex
- Inherits:
-
Object
- Object
- Gitlab::BackgroundMigration::BackfillDraftStatusOnMergeRequestsWithCorrectedRegex
- Defined in:
- lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex.rb
Overview
Backfill draft column on open merge requests based on regex parsing of
their titles.
Defined Under Namespace
Classes: MergeRequest
Instance Method Summary collapse
Instance Method Details
#perform(start_id, end_id) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/gitlab/background_migration/backfill_draft_status_on_merge_requests_with_corrected_regex.rb', line 25 def perform(start_id, end_id) eligible_mrs = MergeRequest.eligible.where(id: start_id..end_id).pluck(:id) eligible_mrs.each_slice(10) do |slice| MergeRequest.where(id: slice).update_all(draft: true) end mark_job_as_succeeded(start_id, end_id) end |