diff options
author | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-06 13:47:18 +0100 |
---|---|---|
committer | Adam Niedzielski <adamsunday@gmail.com> | 2017-01-06 13:47:18 +0100 |
commit | f13c650c161b07bf8d6ad5db849fe9f442f6d0ac (patch) | |
tree | f8517deb61d8e485f8fbe1b6d87142f4c5b43567 /app/controllers/groups | |
parent | aec04a47c16665f1dfb1fb61647c3f78a4dde20f (diff) | |
download | gitlab-ce-f13c650c161b07bf8d6ad5db849fe9f442f6d0ac.tar.gz |
Speed up group milestone index by passing group_id to IssuesFinder
Diffstat (limited to 'app/controllers/groups')
-rw-r--r-- | app/controllers/groups/milestones_controller.rb | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/controllers/groups/milestones_controller.rb b/app/controllers/groups/milestones_controller.rb index 24ec4eec3f2..0d872c86c8a 100644 --- a/app/controllers/groups/milestones_controller.rb +++ b/app/controllers/groups/milestones_controller.rb @@ -1,6 +1,4 @@ class Groups::MilestonesController < Groups::ApplicationController - include GlobalMilestones - before_action :group_projects before_action :milestone, only: [:show, :update] before_action :authorize_admin_milestones!, only: [:new, :create, :update] @@ -73,4 +71,13 @@ class Groups::MilestonesController < Groups::ApplicationController def milestone_path(title) group_milestone_path(@group, title.to_slug.to_s, title: title) end + + def milestones + @milestones = GroupMilestone.build_collection(@group, @projects, params) + end + + def milestone + @milestone = GroupMilestone.build(@group, @projects, params[:title]) + render_404 unless @milestone + end end |