render :nothing option is deprecated, Use head method to respond with empty response body.

This commit is contained in:
Jasper Maes 2018-11-22 18:47:29 +01:00
parent 0a42c7cbaa
commit 6ffdab63c5
6 changed files with 15 additions and 9 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -10,7 +10,7 @@ describe LfsRequest do
def show
storage_project
render nothing: true
head :ok
end
def project