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:
authorMatija Čupić <matteeyah@gmail.com>2018-01-30 04:14:39 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 20:58:20 +0300
commite2c8a2231bcc00e5993411e4ad6c0c0db7e1a297 (patch)
treea6323f1ed92d9d46f74b7f793651d1bff25cda3f /app/controllers/projects
parent04263b9f3be22bd97249162d9d3e27829c639d07 (diff)
Remove usage of VariablePresenter in controller
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/variables_controller.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index b5635ca1b3b..18225218a1b 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -4,10 +4,7 @@ class Projects::VariablesController < Projects::ApplicationController
def show
respond_to do |format|
format.json do
- variables = @project.variables
- .map { |variable| variable.present(current_user: current_user) }
-
- render status: :ok, json: { variables: VariableSerializer.new.represent(variables) }
+ render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) }
end
end
end
@@ -16,10 +13,7 @@ class Projects::VariablesController < Projects::ApplicationController
respond_to do |format|
format.json do
if @project.update(variables_params)
- variables = @project.variables
- .map { |variable| variable.present(current_user: current_user) }
-
- return render status: :ok, json: { variables: VariableSerializer.new.represent(variables) }
+ return render status: :ok, json: { variables: VariableSerializer.new.represent(@project.variables) }
end
render status: :bad_request, json: @project.errors.full_messages