mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-01 06:48:49 +01:00
fix todo feed of actions done in the past seven days. From mailinglist. Thanks Jason
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@833 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
1dd80ad222
commit
61cc1482bd
1 changed files with 6 additions and 5 deletions
|
|
@ -356,10 +356,11 @@ class TodosController < ApplicationController
|
|||
|
||||
def with_feed_query_scope(&block)
|
||||
unless TodosController.is_feed_request(request)
|
||||
yield
|
||||
return
|
||||
Todo.with_scope :find => {:conditions => ['todos.state = ?', 'active']} do
|
||||
yield
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
condition_builder = FindConditionBuilder.new
|
||||
|
||||
if params.key?('done')
|
||||
|
|
@ -440,10 +441,10 @@ class TodosController < ApplicationController
|
|||
# current_users.todos.find but that broke with_scope for :limit
|
||||
|
||||
# Exclude hidden projects from count on home page
|
||||
@todos = Todo.find(:all, :conditions => ['todos.user_id = ? and todos.state = ?', current_user.id, 'active'], :include => [ :project, :context, :tags ])
|
||||
@todos = Todo.find(:all, :conditions => ['todos.user_id = ?', current_user.id], :include => [ :project, :context, :tags ])
|
||||
|
||||
# Exclude hidden projects from the home page
|
||||
@not_done_todos = Todo.find(:all, :conditions => ['todos.user_id = ? and todos.state = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', current_user.id, 'active', false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context, :tags ])
|
||||
@not_done_todos = Todo.find(:all, :conditions => ['todos.user_id = ? AND contexts.hide = ? AND (projects.state = ? OR todos.project_id IS NULL)', current_user.id, false, 'active'], :order => "todos.due IS NULL, todos.due ASC, todos.created_at ASC", :include => [ :project, :context, :tags ])
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue