diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-08-27 17:31:01 +0200 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-09-11 17:32:00 +0200 |
commit | 2039c8280db1646845c33d6c5a74e5f23ca6f4de (patch) | |
tree | e2b3cd3012d9711cda7c6afb962ae4228d59521a /app/controllers/snippets_controller.rb | |
parent | 91c40973dc620430b173ea2df968587d2a708dff (diff) | |
download | gitlab-ce-2039c8280db1646845c33d6c5a74e5f23ca6f4de.tar.gz |
Disable existing offenses for the CodeReuse cops
This whitelists all existing offenses for the various CodeReuse cops, of
which most are triggered by the CodeReuse/ActiveRecord cop.
Diffstat (limited to 'app/controllers/snippets_controller.rb')
-rw-r--r-- | app/controllers/snippets_controller.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/controllers/snippets_controller.rb b/app/controllers/snippets_controller.rb index dcf18c1f751..19d865900e9 100644 --- a/app/controllers/snippets_controller.rb +++ b/app/controllers/snippets_controller.rb @@ -24,6 +24,7 @@ class SnippetsController < ApplicationController layout 'snippets' respond_to :html + # rubocop: disable CodeReuse/ActiveRecord def index if params[:username].present? @user = User.find_by(username: params[:username]) @@ -38,6 +39,7 @@ class SnippetsController < ApplicationController redirect_to(current_user ? dashboard_snippets_path : explore_snippets_path) end end + # rubocop: enable CodeReuse/ActiveRecord def new @snippet = PersonalSnippet.new @@ -94,9 +96,11 @@ class SnippetsController < ApplicationController protected + # rubocop: disable CodeReuse/ActiveRecord def snippet @snippet ||= PersonalSnippet.inc_relations_for_view.find_by(id: params[:id]) end + # rubocop: enable CodeReuse/ActiveRecord alias_method :awardable, :snippet alias_method :spammable, :snippet |