e166e5747c
Enable frozen string for the following files: * lib/gitlab/auth/**/*.rb * lib/gitlab/badge/**/*.rb * lib/gitlab/bare_repository_import/**/*.rb * lib/gitlab/bitbucket_import/**/*.rb * lib/gitlab/bitbucket_server_import/**/*.rb * lib/gitlab/cache/**/*.rb * lib/gitlab/checks/**/*.rb Partially addresses #47424.
22 lines
548 B
Ruby
22 lines
548 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Gitlab
|
|
module Checks
|
|
class MatchingMergeRequest
|
|
def initialize(newrev, branch_name, project)
|
|
@newrev = newrev
|
|
@branch_name = branch_name
|
|
@project = project
|
|
end
|
|
|
|
# rubocop: disable CodeReuse/ActiveRecord
|
|
def match?
|
|
@project.merge_requests
|
|
.with_state(:locked)
|
|
.where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name)
|
|
.exists?
|
|
end
|
|
# rubocop: enable CodeReuse/ActiveRecord
|
|
end
|
|
end
|
|
end
|