From 66b96e0c0cab62eee768faaa7343e7ee4c9e88de Mon Sep 17 00:00:00 2001 From: Matt Rogers Date: Fri, 4 Nov 2011 10:29:09 -0500 Subject: [PATCH] Properly update the project page for hidden projects Immediately after hiding a project, if a user marks a todo as done, they would erroneously see a "There are no incomplete actions in this project" banner under the open actions section. This commit uses the active_or_hidden scope for the project todos in order to fix this, since the todos are active but hidden due to the project. Fixes #1202 --- app/controllers/todos_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/todos_controller.rb b/app/controllers/todos_controller.rb index 61aee981..405a44c6 100644 --- a/app/controllers/todos_controller.rb +++ b/app/controllers/todos_controller.rb @@ -1103,7 +1103,7 @@ class TodosController < ApplicationController if @todo_was_completed_from_deferred_or_blocked_state @remaining_in_context = @remaining_deferred_or_pending_count else - @remaining_in_context = current_user.projects.find(project_id).todos.active.count + @remaining_in_context = current_user.projects.find(project_id).todos.active_or_hidden.count end @target_context_count = current_user.projects.find(project_id).todos.active.count