Fix issues count on labels page

This commit is contained in:
Douglas Barbosa Alexandre 2016-03-21 20:21:23 -03:00
parent 0a8c9f7212
commit 8ca5b33175
2 changed files with 5 additions and 5 deletions

View file

@ -97,12 +97,12 @@ class Label < ActiveRecord::Base
end
end
def open_issues_count
issues.opened.count
def open_issues_count(user = nil)
issues.visible_to_user(user).opened.count
end
def closed_issues_count
issues.closed.count
def closed_issues_count(user = nil)
issues.visible_to_user(user).closed.count
end
def open_merge_requests_count

View file

@ -8,7 +8,7 @@
%strong.append-right-20
= link_to_label(label) do
= pluralize label.open_issues_count, 'open issue'
= pluralize label.open_issues_count(current_user), 'open issue'
- if current_user
.label-subscription{data: {url: toggle_subscription_namespace_project_label_path(@project.namespace, @project, label)}}