fix #1196. You can now transition from pending to project_hidden

One side effect though: althoug dependencies are still in place, the gui cannot differentiate between pending and hidden todos. The views currently do not show dependencies anymore in hidden projects. Postponing a fix for 2.2

Signed-off-by: Reinier Balt <lrbalt@gmail.com>
This commit is contained in:
Reinier Balt 2011-09-14 14:22:30 +02:00
parent 5a168beef9
commit a332f8f557

View file

@ -80,11 +80,12 @@ class Todo < ActiveRecord::Base
end
aasm_event :hide do
transitions :to => :project_hidden, :from => [:active, :deferred]
transitions :to => :project_hidden, :from => [:active, :deferred, :pending]
end
aasm_event :unhide do
transitions :to => :deferred, :from => [:project_hidden], :guard => Proc.new{|t| !t.show_from.blank? }
transitions :to => :pending, :from => [:project_hidden], :guard => :uncompleted_predecessors?
transitions :to => :active, :from => [:project_hidden]
end