diff options
author | Matija Čupić <matteeyah@gmail.com> | 2017-11-16 16:40:30 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2017-11-16 16:40:30 +0300 |
commit | cc0c61155561e5baa1b28319ceb6633858a7d9f8 (patch) | |
tree | 5cbaa7b98ef561022044d1c5f0ae5941aa4189ff /app/controllers/projects/clusters_controller.rb | |
parent | c544266d4c6b40c3d9eb6aeb20fc4a3ccff371b4 (diff) |
Move cluster loading to ClustersController#index
Diffstat (limited to 'app/controllers/projects/clusters_controller.rb')
-rw-r--r-- | app/controllers/projects/clusters_controller.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/app/controllers/projects/clusters_controller.rb b/app/controllers/projects/clusters_controller.rb index 6ffe108f7fa..19ae3192044 100644 --- a/app/controllers/projects/clusters_controller.rb +++ b/app/controllers/projects/clusters_controller.rb @@ -1,6 +1,5 @@ class Projects::ClustersController < Projects::ApplicationController before_action :cluster, except: [:login, :index, :new, :new_gcp, :create] - before_action :clusters, only: [:index] before_action :authorize_read_cluster! before_action :authorize_create_cluster!, only: [:new, :new_gcp, :create] before_action :authorize_google_api, only: [:new_gcp, :create] @@ -8,6 +7,7 @@ class Projects::ClustersController < Projects::ApplicationController before_action :authorize_admin_cluster!, only: [:destroy] def index + @clusters ||= project.clusters.map { |cluster| cluster.present(current_user: current_user) } end def login @@ -87,10 +87,6 @@ class Projects::ClustersController < Projects::ApplicationController @cluster ||= project.clusters.find_by(id: params[:id])&.present(current_user: current_user) || render_404 end - def clusters - @clusters ||= project.clusters.map { |cluster| cluster.present(current_user: current_user) } - end - def create_params params.require(:cluster).permit( :enabled, |