diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2019-02-08 15:19:53 +0300 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2019-03-06 18:51:56 +0300 |
commit | 3288e1a874ec0184f9f27f932748e51c57babf17 (patch) | |
tree | 9f8667f5349ecfc59f3c8a6e9641cb1e32fa3d5b /app/controllers/uploads_controller.rb | |
parent | 7bbdb2a29fbc7b8c9f879c42de7063adaa8313c7 (diff) |
Adds the Rubocop ReturnNil cop
This style change enforces `return if ...` instead of
`return nil if ...` to save maintainers a few minor review points
Diffstat (limited to 'app/controllers/uploads_controller.rb')
-rw-r--r-- | app/controllers/uploads_controller.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/controllers/uploads_controller.rb b/app/controllers/uploads_controller.rb index 519e7439205..568c6e2a852 100644 --- a/app/controllers/uploads_controller.rb +++ b/app/controllers/uploads_controller.rb @@ -28,13 +28,13 @@ class UploadsController < ApplicationController end def find_model - return nil unless params[:id] + return unless params[:id] upload_model_class.find(params[:id]) end def authorize_access! - return nil unless model + return unless model authorized = case model @@ -54,7 +54,7 @@ class UploadsController < ApplicationController end def authorize_create_access! - return nil unless model + return unless model # for now we support only personal snippets comments authorized = can?(current_user, :comment_personal_snippet, model) |