Commit 074fafe9 authored by Eagllus's avatar Eagllus

Update code according comment recommendations

parent 43f32c6b
......@@ -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
......@@ -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
......@@ -10,7 +10,7 @@ class Groups::MilestonesController < Groups::ApplicationController
def index
respond_to do |format|
format.html do
@milestone_states = GlobalMilestone.states_count(group_projects, group)
@milestone_states = Milestone.states_count(group_projects, [group])
@milestones = Kaminari.paginate_array(milestones).page(params[:page])
end
format.json do
......
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