mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-27 17:44:08 +01:00
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:
parent
fa4b1c4c7b
commit
f67e36871c
5 changed files with 29 additions and 24 deletions
|
|
@ -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")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue