debian-mirror-gitlab/lib/gitlab/checks/matching_merge_request.rb

19 lines
422 B
Ruby
Raw Normal View History

2016-08-24 12:49:21 +05:30
module Gitlab
module Checks
class MatchingMergeRequest
def initialize(newrev, branch_name, project)
@newrev = newrev
@branch_name = branch_name
@project = project
end
def match?
@project.merge_requests
.with_state(:locked)
.where(in_progress_merge_commit_sha: @newrev, target_branch: @branch_name)
.exists?
end
end
end
end