diff options
author | Jarka Košanová <jarka@gitlab.com> | 2019-02-12 09:35:34 +0100 |
---|---|---|
committer | Jarka Košanová <jarka@gitlab.com> | 2019-03-28 12:06:31 +0100 |
commit | 96153f2055dc0bcd2ee8b34a36f33529f6ccc50e (patch) | |
tree | 3ff4d56cedc85b600ae3c66bf0c851769fdbc4fd /app/models/label.rb | |
parent | c29a92fc31acaefcc60abf1c9354d148ffc6985c (diff) | |
download | gitlab-ce-96153f2055dc0bcd2ee8b34a36f33529f6ccc50e.tar.gz |
Check if labels are available for target issuable
- labels have to be in the same project/group
as an issuable
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 96bdb7f17c5..e13a2322c6b 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -133,6 +133,10 @@ class Label < ActiveRecord::Base 1 end + def self.by_ids(ids) + where(id: ids) + end + def open_issues_count(user = nil) issues_count(user, state: 'opened') end |