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:
-rw-r--r--app/controllers/projects/blob_controller.rb2
-rw-r--r--app/controllers/projects/branches_controller.rb2
-rw-r--r--app/controllers/projects/merge_requests_controller.rb2
-rw-r--r--changelogs/unreleased/rails5-deprecation-render-nothing.yml6
-rw-r--r--spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb10
-rw-r--r--spec/controllers/concerns/lfs_request_spec.rb2
6 files changed, 15 insertions, 9 deletions
diff --git a/app/controllers/projects/blob_controller.rb b/app/controllers/projects/blob_controller.rb
index 2a6fe3b9c97..873c96a5523 100644
--- a/app/controllers/projects/blob_controller.rb
+++ b/app/controllers/projects/blob_controller.rb
@@ -233,7 +233,7 @@ class Projects::BlobController < Projects::ApplicationController
def validate_diff_params
if [:since, :to, :offset].any? { |key| params[key].blank? }
- render nothing: true
+ head :ok
end
end
diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb
index b7750f4517b..95a014d24da 100644
--- a/app/controllers/projects/branches_controller.rb
+++ b/app/controllers/projects/branches_controller.rb
@@ -105,7 +105,7 @@ class Projects::BranchesController < Projects::ApplicationController
redirect_to project_branches_path(@project), status: :see_other
end
- format.js { render nothing: true, status: result[:return_code] }
+ format.js { head result[:return_code] }
format.json { render json: { message: result[:message] }, status: result[:return_code] }
end
end
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 23d16fed7b9..d521db79f85 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -213,7 +213,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
def rebase
RebaseWorker.perform_async(@merge_request.id, current_user.id)
- render nothing: true, status: :ok
+ head :ok
end
protected
diff --git a/changelogs/unreleased/rails5-deprecation-render-nothing.yml b/changelogs/unreleased/rails5-deprecation-render-nothing.yml
new file mode 100644
index 00000000000..32e2d5800c7
--- /dev/null
+++ b/changelogs/unreleased/rails5-deprecation-render-nothing.yml
@@ -0,0 +1,6 @@
+---
+title: render :nothing option is deprecated, Use head method to respond with empty
+ response body.
+merge_request: 23311
+author: Jasper Maes
+type: other
diff --git a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb
index d20471ef603..3c9452cc42a 100644
--- a/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb
+++ b/spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb
@@ -27,11 +27,11 @@ describe ControllerWithCrossProjectAccessCheck do
if: -> { if_condition }
def index
- render nothing: true
+ head :ok
end
def show
- render nothing: true
+ head :ok
end
def unless_condition
@@ -88,15 +88,15 @@ describe ControllerWithCrossProjectAccessCheck do
if: -> { if_condition }
def index
- render nothing: true
+ head :ok
end
def show
- render nothing: true
+ head :ok
end
def edit
- render nothing: true
+ head :ok
end
def unless_condition
diff --git a/spec/controllers/concerns/lfs_request_spec.rb b/spec/controllers/concerns/lfs_request_spec.rb
index 33b23db302a..76c878ec5d7 100644
--- a/spec/controllers/concerns/lfs_request_spec.rb
+++ b/spec/controllers/concerns/lfs_request_spec.rb
@@ -10,7 +10,7 @@ describe LfsRequest do
def show
storage_project
- render nothing: true
+ head :ok
end
def project