refactor creating todos in todos_controller

This commit is contained in:
Reinier Balt 2013-04-29 15:15:48 +02:00
parent 5ed69fc1a2
commit 010d0e9ba0
4 changed files with 177 additions and 185 deletions

View file

@ -144,6 +144,10 @@ class Todo < ActiveRecord::Base
return !uncompleted_predecessors.all.empty?
end
def should_be_blocked?
return !( uncompleted_predecessors.empty? || state == 'project_hidden' )
end
# Returns a string with description <context, project>
def specification
project_name = self.project.is_a?(NullProject) ? "(none)" : self.project.name