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
This commit is contained in:
Matt Rogers 2011-11-04 10:29:09 -05:00
parent cda75a0cc1
commit 66b96e0c0c

View file

@ -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