Ticket #300: Correctly activates/blocks dependent todos from mobile view also.

Conflicts:

	app/views/todos/toggle_check.js.rjs
This commit is contained in:
Eric Allen 2009-11-10 22:10:52 -05:00
parent c5df6b66b1
commit cb76ecd866
2 changed files with 20 additions and 16 deletions

View file

@ -233,6 +233,16 @@ class Todo < ActiveRecord::Base
@predecessor_array << t.description
end
# Return todos that should be activated if the current todo is completed
def pending_to_activate
return successors.find_all {|t| t.uncompleted_predecessors.empty?}
end
# Return todos that should be blocked if the current todo is undone
def active_to_block
return successors.find_all {|t| t.active?}
end
# Rich Todo API
def self.from_rich_message(user, default_context_id, description, notes)