diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-10 21:30:28 +0300 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-10 21:30:28 +0300 |
commit | b11492c2e36803cf19b175e7d850a72f4e5f9b1f (patch) | |
tree | 2b35b31a1a48a03de47d843a68d1547f9b559d55 /app/views/shared/milestones | |
parent | bb02141e417ff21deb7707a806a313545bbdd5af (diff) |
Use cached values to compute total issues count in milestone index pages
Milestoneish#issues_visible_to_user caches only the ActiveRecord relation,
not the actual result.
Introduce Milestoneish#total_issues_count that relies on the cached method
Milestoneish#count_issues_by_state to reduce the number of queries.
Diffstat (limited to 'app/views/shared/milestones')
-rw-r--r-- | app/views/shared/milestones/_milestone.html.haml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/shared/milestones/_milestone.html.haml b/app/views/shared/milestones/_milestone.html.haml index 3200aacf542..9e6a76e1ddb 100644 --- a/app/views/shared/milestones/_milestone.html.haml +++ b/app/views/shared/milestones/_milestone.html.haml @@ -9,7 +9,7 @@ .pull-right.light #{milestone.percent_complete(current_user)}% complete .row .col-sm-6 - = link_to pluralize(milestone.issues_visible_to_user(current_user).size, 'Issue'), issues_path + = link_to pluralize(milestone.total_issues_count(current_user), 'Issue'), issues_path · = link_to pluralize(milestone.merge_requests.size, 'Merge Request'), merge_requests_path .col-sm-6= milestone_progress_bar(milestone) |