summaryrefslogtreecommitdiff
path: root/app/models/global_milestone.rb
diff options
context:
space:
mode:
authorAhmad Sherif <me@ahmadsherif.com>2016-09-23 13:35:11 +0200
committerAhmad Sherif <me@ahmadsherif.com>2016-09-23 13:35:11 +0200
commit2161c72da01f919aef008c3eb997981374ca1977 (patch)
tree38d02e9324b28780e0400350f360b510b2983095 /app/models/global_milestone.rb
parentb5132118cd43a3e005f0ed159d4a1be34b9a6ce6 (diff)
downloadgitlab-ce-2161c72da01f919aef008c3eb997981374ca1977.tar.gz
Use select(:foo) instead of map(&:foo) in GlobalMilestone
Diffstat (limited to 'app/models/global_milestone.rb')
-rw-r--r--app/models/global_milestone.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/models/global_milestone.rb b/app/models/global_milestone.rb
index 3e10bed19c2..bda2b5c5d5d 100644
--- a/app/models/global_milestone.rb
+++ b/app/models/global_milestone.rb
@@ -32,7 +32,7 @@ class GlobalMilestone
end
def projects
- @projects ||= Project.for_milestones(milestones.map(&:id))
+ @projects ||= Project.for_milestones(milestones.select(:id))
end
def state
@@ -54,11 +54,11 @@ class GlobalMilestone
end
def issues
- @issues ||= Issue.of_milestones(milestones.map(&:id)).includes(:project, :assignee, :labels)
+ @issues ||= Issue.of_milestones(milestones.select(:id)).includes(:project, :assignee, :labels)
end
def merge_requests
- @merge_requests ||= MergeRequest.of_milestones(milestones.map(&:id)).includes(:target_project, :assignee, :labels)
+ @merge_requests ||= MergeRequest.of_milestones(milestones.select(:id)).includes(:target_project, :assignee, :labels)
end
def participants