Class: Gitlab::BackgroundMigration::ResetMergeStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/gitlab/background_migration/reset_merge_status.rb

Overview

Updates the range of given MRs to merge_status “unchecked”, if they're opened and mergeable.

Instance Method Summary collapse

Instance Method Details

#perform(from_id, to_id) ⇒ Object


8
9
10
11
12
13
14
# File 'lib/gitlab/background_migration/reset_merge_status.rb', line 8

def perform(from_id, to_id)
  relation = MergeRequest.where(id: from_id..to_id,
                                state_id: 1, # opened
                                merge_status: 'can_be_merged')

  relation.update_all(merge_status: 'unchecked')
end