fix editing a todo from tag view

saving worked, but the edit form did not disappear and the updated todo did not show up in the right place
This commit is contained in:
Reinier Balt 2008-07-24 23:22:16 +02:00
parent 49aac48616
commit 186fd5694d
3 changed files with 19 additions and 9 deletions

View file

@ -36,9 +36,12 @@ module Tracks
def with_not_done_scope(opts={})
conditions = ["todos.state = ?", 'active']
if opts.has_key?(:include_project_hidden_todos) && (opts[:include_project_hidden_todos] == true)
conditions = ["(todos.state = ? or todos.state = ?)", 'active', 'project_hidden']
conditions = ["(todos.state = ? OR todos.state = ?)", 'active', 'project_hidden']
end
self.todos.send :with_scope, :find => {:conditions => conditions} do
if opts.has_key?(:tag)
conditions = ["todos.state = ? AND taggings.tag_id = ?", 'active', opts[:tag]]
end
self.todos.send :with_scope, :find => {:conditions => conditions, :include => [:taggings]} do
yield
end
end