project.issues_labels method

This commit is contained in:
randx 2012-10-09 20:39:06 +03:00
parent fa325ce977
commit 63fe042d97
3 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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

View file

@ -1,4 +1,5 @@
# 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