diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-11 08:10:04 +0200 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-07-12 18:57:52 +0200 |
commit | 244134f9c33dea0003dc2403dceace4b94a87d2e (patch) | |
tree | 07bbef940f2a33a9b3a510d0c326f3288991fe62 /app/helpers/todos_helper.rb | |
parent | 97999fd4203846ad807de18eab5d7a2176344ce1 (diff) | |
download | gitlab-ce-244134f9c33dea0003dc2403dceace4b94a87d2e.tar.gz |
Cache todos pending/done dashboard query counts
Diffstat (limited to 'app/helpers/todos_helper.rb')
-rw-r--r-- | app/helpers/todos_helper.rb | 4 |
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) |