Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaco Guzman <pacoguzmanp@gmail.com>2016-07-11 09:10:04 +0300
committerPaco Guzman <pacoguzmanp@gmail.com>2016-07-12 19:57:52 +0300
commit244134f9c33dea0003dc2403dceace4b94a87d2e (patch)
tree07bbef940f2a33a9b3a510d0c326f3288991fe62 /app/helpers/todos_helper.rb
parent97999fd4203846ad807de18eab5d7a2176344ce1 (diff)
Cache todos pending/done dashboard query counts
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r--app/helpers/todos_helper.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/helpers/todos_helper.rb b/app/helpers/todos_helper.rb
index a832a6c8df7..0925760e69c 100644
--- a/app/helpers/todos_helper.rb
+++ b/app/helpers/todos_helper.rb
@@ -1,10 +1,10 @@
module TodosHelper
def todos_pending_count
- TodosFinder.new(current_user, state: :pending).execute.count
+ @todos_pending_count ||= TodosFinder.new(current_user, state: :pending).execute.count
end
def todos_done_count
- TodosFinder.new(current_user, state: :done).execute.count
+ @todos_done_count ||= TodosFinder.new(current_user, state: :done).execute.count
end
def todo_action_name(todo)