diff options
Diffstat (limited to 'app/models/group_milestone.rb')
-rw-r--r-- | app/models/group_milestone.rb | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb index 8296a0aa71b..cbd9f2a33cb 100644 --- a/app/models/group_milestone.rb +++ b/app/models/group_milestone.rb @@ -66,14 +66,30 @@ class GroupMilestone end def issues - milestones.map{ |milestone| milestone.issues }.flatten.group_by(&:state) + @group_issues ||= milestones.map{ |milestone| milestone.issues }.flatten.group_by(&:state) end def merge_requests - milestones.map{ |milestone| milestone.merge_requests }.flatten.group_by(&:state) + @group_merge_requests ||= milestones.map{ |milestone| milestone.merge_requests }.flatten.group_by(&:state) end def participants milestones.map{ |milestone| milestone.participants.uniq }.reject(&:empty?).flatten end + + def opened_issues + issues.values_at("opened", "reopened").compact.flatten + end + + def closed_issues + issues['closed'] + end + + def opened_merge_requests + merge_requests.values_at("opened", "reopened").compact.flatten + end + + def closed_merge_requests + merge_requests.values_at("closed", "merged", "locked").compact.flatten + end end |