diff options
author | Eagllus <rvanzon@gitlab.com> | 2018-10-26 13:43:28 +0200 |
---|---|---|
committer | Eagllus <rvanzon@gitlab.com> | 2018-10-26 13:43:28 +0200 |
commit | 3b70cf69188b9906098df5bd984e9337f16e1080 (patch) | |
tree | 5aa88597163100d29e2afb135c30cca8a0d7d58b | |
parent | 0ff5b0f45361cf9fe622cc3265b943a999c14d0e (diff) | |
download | gitlab-ce-3b70cf69188b9906098df5bd984e9337f16e1080.tar.gz |
Update MR based on Sean's feedbackrz_fix_milestone_count
-rw-r--r-- | app/controllers/dashboard/milestones_controller.rb | 2 | ||||
-rw-r--r-- | changelogs/unreleased/rz_fix_milestone_count.yml | 2 | ||||
-rw-r--r-- | spec/models/milestone_spec.rb | 10 |
3 files changed, 7 insertions, 7 deletions
diff --git a/app/controllers/dashboard/milestones_controller.rb b/app/controllers/dashboard/milestones_controller.rb index 8252a0f2511..3802aa5f40f 100644 --- a/app/controllers/dashboard/milestones_controller.rb +++ b/app/controllers/dashboard/milestones_controller.rb @@ -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 diff --git a/changelogs/unreleased/rz_fix_milestone_count.yml b/changelogs/unreleased/rz_fix_milestone_count.yml index f85cfe48b2d..1013b88e0bc 100644 --- a/changelogs/unreleased/rz_fix_milestone_count.yml +++ b/changelogs/unreleased/rz_fix_milestone_count.yml @@ -1,5 +1,5 @@ --- title: Fixing count on Milestones merge_request: 21446 -author: eagllus +author: type: fixed diff --git a/spec/models/milestone_spec.rb b/spec/models/milestone_spec.rb index 651f0540824..d11eb46159e 100644 --- a/spec/models/milestone_spec.rb +++ b/spec/models/milestone_spec.rb @@ -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) |