fix #1310. Add test for this

Found that I had a lot of tests commented out. They have some regressions I will fix later
This commit is contained in:
Reinier Balt 2012-07-15 21:28:42 +02:00
parent 5a24644aad
commit 7c1cd2a144
6 changed files with 696 additions and 694 deletions

View file

@ -209,14 +209,14 @@ class Todo < ActiveRecord::Base
end
def update_state_from_project
if self.state == 'project_hidden' and !self.project.hidden?
if self.state == 'project_hidden' && !self.project.hidden?
if self.uncompleted_predecessors.empty?
self.state = 'active'
self.activate!
else
self.state = 'pending'
self.block!
end
elsif self.state == 'active' and self.project.hidden?
self.state = 'project_hidden'
elsif self.state == 'active' && self.project.hidden?
self.hide!
end
self.save!
end