Skip to content

Commit

Permalink
Fix Rubocop warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Beljajev committed Jul 15, 2018
1 parent 02aad0d commit 20b7571
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 17 deletions.
5 changes: 4 additions & 1 deletion app/controllers/admin/api_users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def edit;
end

def update
params[:api_user].delete(:plain_text_password) if params[:api_user][:plain_text_password].blank?
if params[:api_user][:plain_text_password].blank?
params[:api_user].delete(:plain_text_password)
end

if @api_user.update(api_user_params)
flash[:notice] = I18n.t('record_updated')
redirect_to [:admin, @api_user]
Expand Down
3 changes: 1 addition & 2 deletions app/controllers/admin/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ module Admin
class DashboardController < BaseController
authorize_resource class: false

def show
end
def show; end
end
end
4 changes: 2 additions & 2 deletions app/controllers/admin/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def create

private

def after_sign_in_path_for(resource_or_scope)
def after_sign_in_path_for(_resource_or_scope)
admin_root_path
end

def after_sign_out_path_for(resource_or_scope)
def after_sign_out_path_for(_resource_or_scope)
new_admin_user_session_path
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def update
domain_name: @domain.name,
verification_token: params[:token])

initiator = current_registrant_user ? current_registrant_user.username : t(:user_not_authenticated)
initiator = current_registrant_user ? current_registrant_user.username :
t(:user_not_authenticated)

if params[:rejected]
if @registrant_verification.domain_registrant_delete_reject!("email link #{initiator}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def update
domain_name: @domain.name,
verification_token: params[:token])

initiator = current_registrant_user ? current_registrant_user.username : t(:user_not_authenticated)
initiator = current_registrant_user ? current_registrant_user.username :
t(:user_not_authenticated)

if params[:rejected]
if @registrant_verification.domain_registrant_change_reject!("email link, #{initiator}")
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/registrant/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ def find_user_by_idc(idc)

private

def after_sign_in_path_for(resource_or_scope)
def after_sign_in_path_for(_resource_or_scope)
registrant_root_path
end

def after_sign_out_path_for(resource_or_scope)
def after_sign_out_path_for(_resource_or_scope)
new_registrant_user_session_path
end
end
3 changes: 1 addition & 2 deletions app/controllers/registrar/dashboard_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class Registrar
class DashboardController < BaseController
authorize_resource class: false

def show
end
def show; end
end
end
3 changes: 2 additions & 1 deletion app/controllers/registrar/domain_transfers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ def create
uri = URI.parse("#{ENV['repp_url']}domain_transfers")
request = Net::HTTP::Post.new(uri, 'Content-Type' => 'application/json')
request.body = { data: { domainTransfers: domain_transfers } }.to_json
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
request.basic_auth(current_registrar_user.username,
current_registrar_user.plain_text_password)


if Rails.env.test?
Expand Down
3 changes: 2 additions & 1 deletion app/controllers/registrar/nameservers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ def update
attributes: { hostname: params[:new_hostname],
ipv4: ipv4,
ipv6: ipv6 } } }.to_json
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
request.basic_auth(current_registrar_user.username,
current_registrar_user.plain_text_password)

if Rails.env.test?
response = Net::HTTP.start(uri.hostname, uri.port,
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/registrar/sessions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,11 @@ def check_ip_restriction
render text: t('registrar.authorization.ip_not_allowed', ip: request.ip)
end

def after_sign_in_path_for(resource_or_scope)
def after_sign_in_path_for(_resource_or_scope)
registrar_root_path
end

def after_sign_out_path_for(resource_or_scope)
def after_sign_out_path_for(_resource_or_scope)
new_registrar_user_session_path
end

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/registrar/tech_contacts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ def update
request = Net::HTTP::Patch.new(uri)
request.set_form_data(current_contact_id: params[:current_contact_id],
new_contact_id: params[:new_contact_id])
request.basic_auth(current_registrar_user.username, current_registrar_user.plain_text_password)
request.basic_auth(current_registrar_user.username,
current_registrar_user.plain_text_password)

if Rails.env.test?
response = Net::HTTP.start(uri.hostname, uri.port,
Expand Down
2 changes: 1 addition & 1 deletion app/models/api_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class ApiUser < User
def epp_code_map
{
'2306' => [ # Parameter policy error
[:plain_text_password, :blank]
%i[plain_text_password blank]
]
}
end
Expand Down

0 comments on commit 20b7571

Please sign in to comment.