Simplify some find methods in todo_controller using associations. Fix a bug in the RSS and TEXT feeds created by yesterday's change to the project status.

git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@327 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
lukemelia 2006-10-12 05:00:46 +00:00
parent fa4b1c4c7b
commit f67e36871c
5 changed files with 29 additions and 24 deletions

View file

@ -206,7 +206,7 @@ class ContextController < ApplicationController
def init
@source_view = params['_source_view'] || 'context'
@projects = @user.projects.collect { |x| x.done? ? nil:x }.compact
@projects = @user.projects.reject { |x| x.completed? }
@contexts = @user.contexts
@todos = @user.todos
@done = Todo.find(:all, :conditions => ["todos.user_id = ? and todos.done = ?", @user.id, true], :include => [:project], :order => "completed DESC")