Commit 2161c72d authored by Ahmad Sherif's avatar Ahmad Sherif

Use select(:foo) instead of map(&:foo) in GlobalMilestone

parent b5132118
...@@ -32,7 +32,7 @@ class GlobalMilestone ...@@ -32,7 +32,7 @@ class GlobalMilestone
end end
def projects def projects
@projects ||= Project.for_milestones(milestones.map(&:id)) @projects ||= Project.for_milestones(milestones.select(:id))
end end
def state def state
...@@ -54,11 +54,11 @@ class GlobalMilestone ...@@ -54,11 +54,11 @@ class GlobalMilestone
end end
def issues 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 end
def merge_requests 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 end
def participants def participants
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment