Commit 63fe042d authored by randx's avatar randx

project.issues_labels method

parent fa325ce9
...@@ -7,7 +7,7 @@ class LabelsController < ProjectResourceController ...@@ -7,7 +7,7 @@ class LabelsController < ProjectResourceController
respond_to :js, :html respond_to :js, :html
def index def index
@labels = @project.issues.tag_counts_on(:labels).order('count DESC') @labels = @project.issues_labels.order('count DESC')
end end
protected protected
......
...@@ -159,6 +159,10 @@ class Project < ActiveRecord::Base ...@@ -159,6 +159,10 @@ class Project < ActiveRecord::Base
def project_id def project_id
self.id self.id
end end
def issues_labels
issues.tag_counts_on(:labels)
end
end end
# == Schema Information # == Schema Information
......
# Contains common functionality shared between Issues and MergeRequests # Contains common functionality
# shared between Issues and MergeRequests
module IssueCommonality module IssueCommonality
extend ActiveSupport::Concern extend ActiveSupport::Concern
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment