Commit 3b70cf69 authored by Eagllus's avatar Eagllus

Update MR based on Sean's feedback

parent 0ff5b0f4
......@@ -10,7 +10,7 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
def index
respond_to do |format|
format.html do
@milestone_states = Milestone.states_count(@projects, @groups)
@milestone_states = Milestone.states_count(@projects.select(:id), @groups.select(:id))
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
end
format.json do
......
---
title: Fixing count on Milestones
merge_request: 21446
author: eagllus
author:
type: fixed
......@@ -351,12 +351,12 @@ describe Milestone do
describe '.states_count' do
context 'when the projects have milestones' do
let(:project_1) { create(:project) }
let(:project_2) { create(:project) }
let(:group_1) { create(:group) }
let(:group_2) { create(:group) }
before do
project_1 = create(:project)
project_2 = create(:project)
group_1 = create(:group)
group_2 = create(:group)
create(:active_milestone, title: 'Active Group Milestone', project: project_1)
create(:closed_milestone, title: 'Closed Group Milestone', project: project_1)
create(:active_milestone, title: 'Active Group Milestone', project: project_2)
......
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