diff options
author | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-02 16:46:58 +0300 |
---|---|---|
committer | Paco Guzman <pacoguzmanp@gmail.com> | 2016-06-17 20:04:36 +0300 |
commit | f6bfa46daae3a00ca6f74abb6e6eddc9eac96197 (patch) | |
tree | e80a1c3cde48387c034dbec51636b8d2c5277873 /app/helpers/todos_helper.rb | |
parent | fcd9f90641d5ee59cc84d8388b7cc372370ac25a (diff) |
Cache todo counters (pending/done)
- As todos are created/updated inside the TodoService
we repopulate the cache just there for both pending/done todos
- Todos as mark as done from the TodosController we update cache
there too
- All the added methods are kept in the User class for cohesion
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 9adf5ef29f7..c7aeed4b9fc 100644 --- a/app/helpers/todos_helper.rb +++ b/app/helpers/todos_helper.rb @@ -1,10 +1,10 @@ module TodosHelper def todos_pending_count - current_user.todos.pending.count + current_user.todos_pending_count end def todos_done_count - current_user.todos.done.count + current_user.todos_done_count end def todo_action_name(todo) |