mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-02 22:11:48 +01:00
parent
9089e15788
commit
e0143cf435
3 changed files with 23 additions and 4 deletions
|
|
@ -408,4 +408,16 @@ class Todo < ActiveRecord::Base
|
|||
count
|
||||
end
|
||||
|
||||
def destroy
|
||||
# activate successors if they only depend on this action
|
||||
self.pending_successors.each do |successor|
|
||||
successor.uncompleted_predecessors.delete(self)
|
||||
if successor.uncompleted_predecessors.empty?
|
||||
successor.activate!
|
||||
end
|
||||
end
|
||||
|
||||
super
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue