debian-mirror-gitlab/lib/gitlab/background_migration/reset_merge_status.rb

18 lines
511 B
Ruby
Raw Normal View History

2019-09-04 21:01:54 +05:30
# frozen_string_literal: true
module Gitlab
module BackgroundMigration
# Updates the range of given MRs to merge_status "unchecked", if they're opened
# and mergeable.
class ResetMergeStatus
def perform(from_id, to_id)
relation = MergeRequest.where(id: from_id..to_id,
2020-06-23 00:09:42 +05:30
state_id: 1, # opened
2019-09-04 21:01:54 +05:30
merge_status: 'can_be_merged')
relation.update_all(merge_status: 'unchecked')
end
end
end
end