summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/labels_controller.rb2
-rw-r--r--app/models/project.rb4
-rw-r--r--app/roles/issue_commonality.rb3
3 files changed, 7 insertions, 2 deletions
diff --git a/app/controllers/labels_controller.rb b/app/controllers/labels_controller.rb
index 3cbbb8692e0..999351e22df 100644
--- a/app/controllers/labels_controller.rb
+++ b/app/controllers/labels_controller.rb
@@ -7,7 +7,7 @@ class LabelsController < ProjectResourceController
respond_to :js, :html
def index
- @labels = @project.issues.tag_counts_on(:labels).order('count DESC')
+ @labels = @project.issues_labels.order('count DESC')
end
protected
diff --git a/app/models/project.rb b/app/models/project.rb
index f4d868874b9..3ae15f24b1f 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -159,6 +159,10 @@ class Project < ActiveRecord::Base
def project_id
self.id
end
+
+ def issues_labels
+ issues.tag_counts_on(:labels)
+ end
end
# == Schema Information
diff --git a/app/roles/issue_commonality.rb b/app/roles/issue_commonality.rb
index b21d92a3083..4aee916c03c 100644
--- a/app/roles/issue_commonality.rb
+++ b/app/roles/issue_commonality.rb
@@ -1,4 +1,5 @@
-# Contains common functionality shared between Issues and MergeRequests
+# Contains common functionality
+# shared between Issues and MergeRequests
module IssueCommonality
extend ActiveSupport::Concern