Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
6ffdab63
Commit
6ffdab63
authored
Nov 22, 2018
by
Jasper Maes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
render :nothing option is deprecated, Use head method to respond with empty response body.
parent
0a42c7cb
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
9 deletions
+15
-9
app/controllers/projects/blob_controller.rb
app/controllers/projects/blob_controller.rb
+1
-1
app/controllers/projects/branches_controller.rb
app/controllers/projects/branches_controller.rb
+1
-1
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
changelogs/unreleased/rails5-deprecation-render-nothing.yml
changelogs/unreleased/rails5-deprecation-render-nothing.yml
+6
-0
spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb
...ncerns/controller_with_cross_project_access_check_spec.rb
+5
-5
spec/controllers/concerns/lfs_request_spec.rb
spec/controllers/concerns/lfs_request_spec.rb
+1
-1
No files found.
app/controllers/projects/blob_controller.rb
View file @
6ffdab63
...
@@ -233,7 +233,7 @@ class Projects::BlobController < Projects::ApplicationController
...
@@ -233,7 +233,7 @@ class Projects::BlobController < Projects::ApplicationController
def
validate_diff_params
def
validate_diff_params
if
[
:since
,
:to
,
:offset
].
any?
{
|
key
|
params
[
key
].
blank?
}
if
[
:since
,
:to
,
:offset
].
any?
{
|
key
|
params
[
key
].
blank?
}
render
nothing:
true
head
:ok
end
end
end
end
...
...
app/controllers/projects/branches_controller.rb
View file @
6ffdab63
...
@@ -105,7 +105,7 @@ class Projects::BranchesController < Projects::ApplicationController
...
@@ -105,7 +105,7 @@ class Projects::BranchesController < Projects::ApplicationController
redirect_to
project_branches_path
(
@project
),
status: :see_other
redirect_to
project_branches_path
(
@project
),
status: :see_other
end
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
]
}
format
.
json
{
render
json:
{
message:
result
[
:message
]
},
status:
result
[
:return_code
]
}
end
end
end
end
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
6ffdab63
...
@@ -213,7 +213,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -213,7 +213,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
def
rebase
def
rebase
RebaseWorker
.
perform_async
(
@merge_request
.
id
,
current_user
.
id
)
RebaseWorker
.
perform_async
(
@merge_request
.
id
,
current_user
.
id
)
render
nothing:
true
,
status:
:ok
head
:ok
end
end
protected
protected
...
...
changelogs/unreleased/rails5-deprecation-render-nothing.yml
0 → 100644
View file @
6ffdab63
---
title
:
render :nothing option is deprecated, Use head method to respond with empty
response body.
merge_request
:
23311
author
:
Jasper Maes
type
:
other
spec/controllers/concerns/controller_with_cross_project_access_check_spec.rb
View file @
6ffdab63
...
@@ -27,11 +27,11 @@ describe ControllerWithCrossProjectAccessCheck do
...
@@ -27,11 +27,11 @@ describe ControllerWithCrossProjectAccessCheck do
if:
->
{
if_condition
}
if:
->
{
if_condition
}
def
index
def
index
render
nothing:
true
head
:ok
end
end
def
show
def
show
render
nothing:
true
head
:ok
end
end
def
unless_condition
def
unless_condition
...
@@ -88,15 +88,15 @@ describe ControllerWithCrossProjectAccessCheck do
...
@@ -88,15 +88,15 @@ describe ControllerWithCrossProjectAccessCheck do
if:
->
{
if_condition
}
if:
->
{
if_condition
}
def
index
def
index
render
nothing:
true
head
:ok
end
end
def
show
def
show
render
nothing:
true
head
:ok
end
end
def
edit
def
edit
render
nothing:
true
head
:ok
end
end
def
unless_condition
def
unless_condition
...
...
spec/controllers/concerns/lfs_request_spec.rb
View file @
6ffdab63
...
@@ -10,7 +10,7 @@ describe LfsRequest do
...
@@ -10,7 +10,7 @@ describe LfsRequest do
def
show
def
show
storage_project
storage_project
render
nothing:
true
head
:ok
end
end
def
project
def
project
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment