mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-04 23:11:47 +01:00
fix #1271. Don't block an already blocked todo. Create tests for this case
This commit is contained in:
parent
4db90386a8
commit
dcb155d90d
6 changed files with 158 additions and 61 deletions
|
|
@ -164,10 +164,14 @@ class Todo < ActiveRecord::Base
|
|||
return @removed_predecessors
|
||||
end
|
||||
|
||||
# remove predecessor and activate myself if it was the last predecessor
|
||||
def remove_predecessor(predecessor)
|
||||
# remove predecessor and activate myself
|
||||
self.predecessors.delete(predecessor)
|
||||
self.activate!
|
||||
if self.predecessors.empty?
|
||||
self.activate!
|
||||
else
|
||||
save!
|
||||
end
|
||||
end
|
||||
|
||||
# Returns true if t is equal to self or a successor of self
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue