Find cluster by id in ClustersController#cluster

Prepares the controller for handling multiple clusters instead of just
one.
This commit is contained in:
Matija Čupić 2017-11-15 20:15:48 +01:00
parent c3d8bc3548
commit 9809e1d404
No known key found for this signature in database
GPG Key ID: 4BAF84FFACD2E5DE
1 changed files with 1 additions and 1 deletions

View File

@ -88,7 +88,7 @@ class Projects::ClustersController < Projects::ApplicationController
private
def cluster
@cluster ||= project.cluster.present(current_user: current_user)
@cluster ||= project.clusters.find_by(id: params[:id])&.present(current_user: current_user) || render_404
end
def create_params