Commit 63fe042d97a5430770ec50fc0e8f29c416bd2ec9
1 parent
fa325ce9
Exists in
master
and in
4 other branches
project.issues_labels method
Showing
3 changed files
with
7 additions
and
2 deletions
Show diff stats
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