diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /app/models/label_link.rb | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to 'app/models/label_link.rb')
-rw-r--r-- | app/models/label_link.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/label_link.rb b/app/models/label_link.rb index 5ae1e88e14e..a466fe69300 100644 --- a/app/models/label_link.rb +++ b/app/models/label_link.rb @@ -9,4 +9,7 @@ class LabelLink < ApplicationRecord validates :target, presence: true, unless: :importing? validates :label, presence: true, unless: :importing? + + scope :for_target, -> (target_id, target_type) { where(target_id: target_id, target_type: target_type) } + scope :with_remove_on_close_labels, -> { joins(:label).where(labels: { remove_on_close: true }) } end |