Commit 63fe042d97a5430770ec50fc0e8f29c416bd2ec9

Authored by randx
1 parent fa325ce9

project.issues_labels method

app/controllers/labels_controller.rb
@@ -7,7 +7,7 @@ class LabelsController < ProjectResourceController @@ -7,7 +7,7 @@ class LabelsController < ProjectResourceController
7 respond_to :js, :html 7 respond_to :js, :html
8 8
9 def index 9 def index
10 - @labels = @project.issues.tag_counts_on(:labels).order('count DESC') 10 + @labels = @project.issues_labels.order('count DESC')
11 end 11 end
12 12
13 protected 13 protected
app/models/project.rb
@@ -159,6 +159,10 @@ class Project < ActiveRecord::Base @@ -159,6 +159,10 @@ class Project < ActiveRecord::Base
159 def project_id 159 def project_id
160 self.id 160 self.id
161 end 161 end
  162 +
  163 + def issues_labels
  164 + issues.tag_counts_on(:labels)
  165 + end
162 end 166 end
163 167
164 # == Schema Information 168 # == Schema Information
app/roles/issue_commonality.rb
1 -# Contains common functionality shared between Issues and MergeRequests 1 +# Contains common functionality
  2 +# shared between Issues and MergeRequests
2 module IssueCommonality 3 module IssueCommonality
3 extend ActiveSupport::Concern 4 extend ActiveSupport::Concern
4 5