diff --git a/app/controllers/admin/api_users_controller.rb b/app/controllers/admin/api_users_controller.rb index 7f6eb1a3d..bbf0a8a4e 100644 --- a/app/controllers/admin/api_users_controller.rb +++ b/app/controllers/admin/api_users_controller.rb @@ -32,7 +32,10 @@ module Admin 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] diff --git a/app/controllers/admin/dashboard_controller.rb b/app/controllers/admin/dashboard_controller.rb index 35efab599..f48698780 100644 --- a/app/controllers/admin/dashboard_controller.rb +++ b/app/controllers/admin/dashboard_controller.rb @@ -2,7 +2,6 @@ module Admin class DashboardController < BaseController authorize_resource class: false - def show - end + def show; end end end \ No newline at end of file diff --git a/app/controllers/admin/sessions_controller.rb b/app/controllers/admin/sessions_controller.rb index 7c396845c..c0b47e687 100644 --- a/app/controllers/admin/sessions_controller.rb +++ b/app/controllers/admin/sessions_controller.rb @@ -24,11 +24,11 @@ module Admin 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 diff --git a/app/controllers/registrant/domain_delete_confirms_controller.rb b/app/controllers/registrant/domain_delete_confirms_controller.rb index a57c6178a..d6e4666c7 100644 --- a/app/controllers/registrant/domain_delete_confirms_controller.rb +++ b/app/controllers/registrant/domain_delete_confirms_controller.rb @@ -19,7 +19,8 @@ class Registrant::DomainDeleteConfirmsController < RegistrantController 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}") diff --git a/app/controllers/registrant/domain_update_confirms_controller.rb b/app/controllers/registrant/domain_update_confirms_controller.rb index 8c91db6ac..413ac43ff 100644 --- a/app/controllers/registrant/domain_update_confirms_controller.rb +++ b/app/controllers/registrant/domain_update_confirms_controller.rb @@ -19,7 +19,8 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController 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}") diff --git a/app/controllers/registrant/sessions_controller.rb b/app/controllers/registrant/sessions_controller.rb index c29c920b0..38efe9406 100644 --- a/app/controllers/registrant/sessions_controller.rb +++ b/app/controllers/registrant/sessions_controller.rb @@ -1,8 +1,7 @@ class Registrant::SessionsController < Devise::SessionsController layout 'registrant/application' - def new - end + def new; end def id id_code, id_issuer = request.env['SSL_CLIENT_S_DN'], request.env['SSL_CLIENT_I_DN_O'] @@ -99,11 +98,11 @@ class Registrant::SessionsController < Devise::SessionsController 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 \ No newline at end of file diff --git a/app/controllers/registrar/dashboard_controller.rb b/app/controllers/registrar/dashboard_controller.rb index 468c7513a..2b8fd2430 100644 --- a/app/controllers/registrar/dashboard_controller.rb +++ b/app/controllers/registrar/dashboard_controller.rb @@ -2,7 +2,6 @@ class Registrar class DashboardController < BaseController authorize_resource class: false - def show - end + def show; end end end \ No newline at end of file diff --git a/app/controllers/registrar/domain_transfers_controller.rb b/app/controllers/registrar/domain_transfers_controller.rb index 71cbb306d..acacc3ef4 100644 --- a/app/controllers/registrar/domain_transfers_controller.rb +++ b/app/controllers/registrar/domain_transfers_controller.rb @@ -21,7 +21,8 @@ class Registrar 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? diff --git a/app/controllers/registrar/invoices_controller.rb b/app/controllers/registrar/invoices_controller.rb index 548e47ebe..c29558e0f 100644 --- a/app/controllers/registrar/invoices_controller.rb +++ b/app/controllers/registrar/invoices_controller.rb @@ -6,7 +6,8 @@ class Registrar def index params[:q] ||= {} - invoices = current_registrar_user.registrar.invoices.includes(:invoice_items, :account_activity) + invoices = current_registrar_user.registrar.invoices + .includes(:invoice_items, :account_activity) normalize_search_parameters do @q = invoices.search(params[:q]) diff --git a/app/controllers/registrar/nameservers_controller.rb b/app/controllers/registrar/nameservers_controller.rb index af2e00f7f..95da7e329 100644 --- a/app/controllers/registrar/nameservers_controller.rb +++ b/app/controllers/registrar/nameservers_controller.rb @@ -12,7 +12,8 @@ class Registrar 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, diff --git a/app/controllers/registrar/sessions_controller.rb b/app/controllers/registrar/sessions_controller.rb index e1c98785b..b3998f046 100644 --- a/app/controllers/registrar/sessions_controller.rb +++ b/app/controllers/registrar/sessions_controller.rb @@ -171,11 +171,11 @@ class Registrar 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 diff --git a/app/controllers/registrar/tech_contacts_controller.rb b/app/controllers/registrar/tech_contacts_controller.rb index 22d667a41..1d459ef0f 100644 --- a/app/controllers/registrar/tech_contacts_controller.rb +++ b/app/controllers/registrar/tech_contacts_controller.rb @@ -8,7 +8,8 @@ class Registrar 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, diff --git a/app/models/api_user.rb b/app/models/api_user.rb index da3497dd8..ccc71eac0 100644 --- a/app/models/api_user.rb +++ b/app/models/api_user.rb @@ -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