diff options
Diffstat (limited to 'app/models/group_milestone.rb')
-rw-r--r-- | app/models/group_milestone.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb index c2fb3a5edee..132c0eb2497 100644 --- a/app/models/group_milestone.rb +++ b/app/models/group_milestone.rb @@ -38,4 +38,13 @@ class GroupMilestone rescue ZeroDivisionError 100 end + + def state + state = milestones.map{ |milestone| milestone.state } + if state.all?{ |milestone_state| milestone_state == 'active' } + 'active' + else + 'closed' + end + end end |