Skip to content
Snippets Groups Projects
Commit 3992e226 authored by Alfredo Sumaran's avatar Alfredo Sumaran
Browse files

Add association to merge requests

parent 6aa50165
No related branches found
No related tags found
1 merge request!3057Add link to open merge requests on label index
Loading
Loading
@@ -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? }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment