Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/approval.rb')
-rw-r--r--app/models/approval.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/approval.rb b/app/models/approval.rb
index ecc15077c8d..c3992994dd3 100644
--- a/app/models/approval.rb
+++ b/app/models/approval.rb
@@ -14,4 +14,7 @@ class Approval < ApplicationRecord
validates :user_id, presence: true, uniqueness: { scope: [:merge_request_id] }
scope :with_user, -> { joins(:user) }
+ scope :with_invalid_patch_id_sha, ->(patch_id_sha) do
+ where.not(patch_id_sha: patch_id_sha).or(where(patch_id_sha: nil))
+ end
end