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

@ -10,31 +10,29 @@ class ConsumersController < ApplicationController
end
private :authorize!
def create
@consumer = Consumer.new(consumer_params)
def index
@consumers = Consumer.paginate(page: params[:page], per_page: per_page_param)
authorize!
create_and_respond(object: @consumer)
end
def destroy
destroy_and_respond(object: @consumer)
end
def show; end
def edit; end
def new
@consumer = Consumer.new(oauth_key: SecureRandom.hex, oauth_secret: SecureRandom.hex)
authorize!
end
def consumer_params
params[:consumer].permit(:name, :oauth_key, :oauth_secret) if params[:consumer].present?
end
private :consumer_params
def index
@consumers = Consumer.paginate(page: params[:page], per_page: per_page_param)
authorize!
end
def edit; end
def new
@consumer = Consumer.new(oauth_key: SecureRandom.hex, oauth_secret: SecureRandom.hex)
def create
@consumer = Consumer.new(consumer_params)
authorize!
create_and_respond(object: @consumer)
end
def set_consumer
@ -43,9 +41,11 @@ class ConsumersController < ApplicationController
end
private :set_consumer
def show; end
def update
update_and_respond(object: @consumer, params: consumer_params)
end
def destroy
destroy_and_respond(object: @consumer)
end
end