summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard
diff options
context:
space:
mode:
authorEagllus <rvanzon@gitlab.com>2018-10-16 14:52:08 +0200
committerEagllus <rvanzon@gitlab.com>2018-10-16 15:13:03 +0200
commit074fafe9e09935cd53cf286ad00b9d53240a9413 (patch)
tree85bbdae9cdec3cede37881d28a41c8a06df0cad3 /app/controllers/dashboard
parent43f32c6bf966a85d6d5e1d8933a1cea67ec89ba4 (diff)
downloadgitlab-ce-074fafe9e09935cd53cf286ad00b9d53240a9413.tar.gz
Update code according comment recommendations
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r--app/controllers/dashboard/application_controller.rb4
-rw-r--r--app/controllers/dashboard/milestones_controller.rb8
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/dashboard/application_controller.rb b/app/controllers/dashboard/application_controller.rb
index 1c9a5917da5..cee0753a021 100644
--- a/app/controllers/dashboard/application_controller.rb
+++ b/app/controllers/dashboard/application_controller.rb
@@ -12,8 +12,4 @@ class Dashboard::ApplicationController < ApplicationController
def projects
@projects ||= current_user.authorized_projects.sorted_by_activity.non_archived
end
-
- def groups
- @groups ||= GroupsFinder.new(current_user, state_all: true).execute
- end
end
diff --git a/app/controllers/dashboard/milestones_controller.rb b/app/controllers/dashboard/milestones_controller.rb
index ddc1a66d11d..8252a0f2511 100644
--- a/app/controllers/dashboard/milestones_controller.rb
+++ b/app/controllers/dashboard/milestones_controller.rb
@@ -4,13 +4,13 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
include MilestoneActions
before_action :projects
- before_action :groups
+ before_action :groups, only: :index
before_action :milestone, only: [:show, :merge_requests, :participants, :labels]
def index
respond_to do |format|
format.html do
- @milestone_states = GlobalMilestone.states_count(@projects, @groups)
+ @milestone_states = Milestone.states_count(@projects, @groups)
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
end
format.json do
@@ -43,4 +43,8 @@ class Dashboard::MilestonesController < Dashboard::ApplicationController
@milestone = DashboardMilestone.build(@projects, params[:title])
render_404 unless @milestone
end
+
+ def groups
+ @groups ||= GroupsFinder.new(current_user, state_all: true).execute
+ end
end