first version of review view

This commit is contained in:
sfischme 2011-09-16 23:34:09 -04:00
parent 5f0bcebca9
commit ac98737176
8 changed files with 82 additions and 5 deletions

View file

@ -108,7 +108,28 @@ class Project < ActiveRecord::Base
end
def needs_review?(current_user)
return (last_reviewed < current_user.time ) # - current_user.prefs.review_period.days)
return false unless !nil?
return true if last_reviewed.nil?
return (active? && (last_reviewed < current_user.time - current_user.prefs.review_period.days))
end
def blocked?
## mutually exclusive for stalled and blocked
return false if stalled?
is_blocked = true
todos.each do |t|
is_blocked = false if (!t.completed? && !t.deferred? && !t.pending?)
end
return is_blocked
end
def stalled?
return true if todos.count == 0
is_stalled = true
todos.each do |t|
is_stalled = false if (!t.completed?)
end
return is_stalled
end