Fixed the count of undone items on the main page again, after breaking it ;-)

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@11 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
bsag 2005-01-23 12:31:10 +00:00
parent f7b77f6fd9
commit 3c196c46d8
6 changed files with 9 additions and 6 deletions

View file

@ -3,7 +3,6 @@ class TodoController < ApplicationController
helper :todo
model :context, :project
scaffold :todo
before_filter :login_required
caches_action :list, :completed
layout "standard"
@ -16,6 +15,7 @@ class TodoController < ApplicationController
@places = Context.find_all
@projects = Project.find_all
@done = Todo.find_all( "done=1", "completed DESC", 5 )
@count = Todo.count( "done=0" )
end
@ -102,7 +102,7 @@ class TodoController < ApplicationController
def toggle_check
item = Todo.find(@params['id'])
item.toggle('done')
item.toggle!('done')
if item.save
flash["confirmation"] = "Next action marked as completed"