diff options
author | Marin Jankovski <marin@gitlab.com> | 2014-06-26 11:58:40 +0200 |
---|---|---|
committer | Marin Jankovski <marin@gitlab.com> | 2014-06-30 09:44:30 +0200 |
commit | 4ca8a175a2695dd2fc28084253a4471bad30bf00 (patch) | |
tree | ca4ac77b34da9e2351f355fe44c11ef8af03d951 /app/models/group_milestone.rb | |
parent | 0723bf1afaaf13ddcb58c211161389052d18e501 (diff) | |
download | gitlab-ce-4ca8a175a2695dd2fc28084253a4471bad30bf00.tar.gz |
Filter group milestones.
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 |