Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-06-20 13:23:33 +0300
committerJose <jvargas@gitlab.com>2018-06-27 07:06:24 +0300
commit3c49bcb602a38364d0034bfe927097bedbca986c (patch)
treeee2fff1eabed9962dd473c133786164dff2c4fb1 /app/controllers/projects/application_controller.rb
parent292cf668905a55e7b305c67b314cb039d2681a54 (diff)
Adds metrics to Operartions tab in projects sidebar
Diffstat (limited to 'app/controllers/projects/application_controller.rb')
-rw-r--r--app/controllers/projects/application_controller.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/controllers/projects/application_controller.rb b/app/controllers/projects/application_controller.rb
index 5ab6d103c89..719a3c37f45 100644
--- a/app/controllers/projects/application_controller.rb
+++ b/app/controllers/projects/application_controller.rb
@@ -5,6 +5,7 @@ class Projects::ApplicationController < ApplicationController
skip_before_action :authenticate_user!
before_action :project
before_action :repository
+ before_action :environment
layout 'project'
helper_method :repository, :can_collaborate_with_project?, :user_access
@@ -32,6 +33,10 @@ class Projects::ApplicationController < ApplicationController
@repository ||= project.repository
end
+ def environment
+ @environment ||= project.environments.first
+ end
+
def authorize_action!(action)
unless can?(current_user, action, project)
return access_denied!