From 58ecb06f74f9aa6af46f7110cb5753e1f30790cd Mon Sep 17 00:00:00 2001
From: Douwe Maan <douwe@gitlab.com>
Date: Thu, 5 Feb 2015 21:26:57 +0100
Subject: [PATCH] Remove duplicates from group milestone participants list.

---
 CHANGELOG                     | 2 +-
 app/models/group_milestone.rb | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CHANGELOG b/CHANGELOG
index 235a99b4327..95be0f8f2ba 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -49,7 +49,7 @@ v 7.8.0
   - 
   - Add action property to merge request hook (Julien Bianchi)
   - 
-  - 
+  - Remove duplicates from group milestone participants list.
   - 
   - 
   - Add a new API function that retrieves all issues assigned to a single milestone (Justin Whear and Hannes Rosenögger)
diff --git a/app/models/group_milestone.rb b/app/models/group_milestone.rb
index 33915313789..7e4f16ebf16 100644
--- a/app/models/group_milestone.rb
+++ b/app/models/group_milestone.rb
@@ -66,15 +66,15 @@ class GroupMilestone
   end
 
   def issues
-    @group_issues ||= milestones.map { |milestone| milestone.issues }.flatten.group_by(&:state)
+    @group_issues ||= milestones.map(&:issues).flatten.group_by(&:state)
   end
 
   def merge_requests
-    @group_merge_requests ||= milestones.map { |milestone| milestone.merge_requests }.flatten.group_by(&:state)
+    @group_merge_requests ||= milestones.map(&:merge_requests).flatten.group_by(&:state)
   end
 
   def participants
-    milestones.map { |milestone| milestone.participants.uniq }.reject(&:empty?).flatten
+    @group_participants ||= milestones.map(&:participants).flatten.compact.uniq
   end
 
   def opened_issues
-- 
GitLab