diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-02 05:04:13 +0300 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2016-03-02 05:04:13 +0300 |
commit | 3992e2269b35748b0167aff69225407bd189a931 (patch) | |
tree | abad8419518023a41bc87b1be846099580869217 /app/models/label.rb | |
parent | 6aa50165b0acc355925e271f07ef8e87291e0232 (diff) |
Add association to merge requests
Diffstat (limited to 'app/models/label.rb')
-rw-r--r-- | app/models/label.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/app/models/label.rb b/app/models/label.rb index 07a1db4abe5..10dd5cd3836 100644 --- a/app/models/label.rb +++ b/app/models/label.rb @@ -27,6 +27,7 @@ class Label < ActiveRecord::Base belongs_to :project has_many :label_links, dependent: :destroy has_many :issues, through: :label_links, source: :target, source_type: 'Issue' + has_many :merge_requests, through: :label_links, source: :target, source_type: 'MergeRequest' validates :color, color: true, allow_blank: false validates :project, presence: true, unless: Proc.new { |service| service.template? } |