Fix Rubocop offenses

This commit is contained in:
Sebastian Serth
2022-10-24 12:10:10 +02:00
parent b32bf1232b
commit c75f52f2c8
20 changed files with 222 additions and 222 deletions

View File

@ -11,17 +11,17 @@ class TipsController < ApplicationController
end
private :authorize!
def create
@tip = Tip.new(tip_params)
def index
@tips = Tip.all.paginate(page: params[:page], per_page: per_page_param)
authorize!
create_and_respond(object: @tip)
end
def destroy
destroy_and_respond(object: @tip)
end
def show; end
def edit; end
def new
@tip = Tip.new
authorize!
end
def tip_params
return if params[:tip].blank?
@ -33,14 +33,12 @@ class TipsController < ApplicationController
end
private :tip_params
def index
@tips = Tip.all.paginate(page: params[:page], per_page: per_page_param)
authorize!
end
def edit; end
def new
@tip = Tip.new
def create
@tip = Tip.new(tip_params)
authorize!
create_and_respond(object: @tip)
end
def set_tip
@ -49,12 +47,14 @@ class TipsController < ApplicationController
end
private :set_tip
def show; end
def update
update_and_respond(object: @tip, params: tip_params)
end
def destroy
destroy_and_respond(object: @tip)
end
def set_file_types
@file_types = FileType.all.order(:name)
end