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:
authorAlfredo Sumaran <alfredo@gitlab.com>2016-03-02 05:04:13 +0300
committerAlfredo Sumaran <alfredo@gitlab.com>2016-03-02 05:04:13 +0300
commit3992e2269b35748b0167aff69225407bd189a931 (patch)
treeabad8419518023a41bc87b1be846099580869217 /app/models/label.rb
parent6aa50165b0acc355925e271f07ef8e87291e0232 (diff)
Add association to merge requests
Diffstat (limited to 'app/models/label.rb')
-rw-r--r--app/models/label.rb1
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? }