Add and apply Rails/HttpStatus rubocop rule

We were already using it in most places. Since rubocop-rails 2.11.0,
this rule also detects offenses when using the `head` method, which we
were using with a plain `404`.
This commit is contained in:
Javi Martín
2021-08-11 05:09:45 +02:00
parent 591b09d6ea
commit 2bfa9068f1
3 changed files with 5 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ class DirectUploadsController < ApplicationController
attachment_url: @direct_upload.relation.attachment.url }
else
render json: { errors: @direct_upload.errors[:attachment].join(", ") },
status: 422
status: :unprocessable_entity
end
end