mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 20:08:51 +01:00
Fixes #658. Do better counting for hidden projects
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@758 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
ceeecbb809
commit
9878d5ab55
2 changed files with 2 additions and 2 deletions
|
|
@ -198,7 +198,7 @@ class ApplicationController < ActionController::Base
|
|||
|
||||
def init_project_hidden_todo_counts(parents = ['project','context'])
|
||||
parents.each do |parent|
|
||||
eval("@#{parent}_project_hidden_todo_counts = @#{parent}_project_hidden_todo_counts || Todo.count(:conditions => ['user_id = ? and state = ?', current_user.id, 'project_hidden'], :group => :#{parent}_id)")
|
||||
eval("@#{parent}_project_hidden_todo_counts = @#{parent}_project_hidden_todo_counts || Todo.count(:conditions => ['user_id = ? and (state = ? or state = ?)', current_user.id, 'project_hidden', 'active'], :group => :#{parent}_id)")
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -459,7 +459,7 @@ class TodosController < ApplicationController
|
|||
end
|
||||
from.project do
|
||||
unless @todo.project_id == nil
|
||||
@down_count = current_user.projects.find(@todo.project_id).not_done_todo_count
|
||||
@down_count = current_user.projects.find(@todo.project_id).not_done_todo_count(:include_project_hidden_todos => true)
|
||||
@deferred_count = current_user.projects.find(@todo.project_id).deferred_todo_count
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue