From 2410f5d0f8ca741dfb7436d3cc318c3e8bd82cea Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Tue, 17 May 2022 13:28:55 +0100 Subject: [PATCH] Rubocop --- app/controllers/auth/confirmations_controller.rb | 5 ++--- app/mailers/devise_notify_mailer.rb | 6 +++--- app/models/user.rb | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/app/controllers/auth/confirmations_controller.rb b/app/controllers/auth/confirmations_controller.rb index 90d764881..a888253fd 100644 --- a/app/controllers/auth/confirmations_controller.rb +++ b/app/controllers/auth/confirmations_controller.rb @@ -1,5 +1,4 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController - # GET /resource/confirmation?confirmation_token=abcdef def show self.resource = resource_class.confirm_by_token(params[:confirmation_token]) @@ -13,10 +12,10 @@ class Auth::ConfirmationsController < Devise::ConfirmationsController url = "#{base}?reset_password_token=#{token}" redirect_to url else - respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) } + respond_with_navigational(resource) { redirect_to after_confirmation_path_for(resource_name, resource) } end else - respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new } + respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new } end end end diff --git a/app/mailers/devise_notify_mailer.rb b/app/mailers/devise_notify_mailer.rb index f04452f0f..cd5500d86 100644 --- a/app/mailers/devise_notify_mailer.rb +++ b/app/mailers/devise_notify_mailer.rb @@ -14,7 +14,7 @@ class DeviseNotifyMailer < Devise::Mailer end def personalisation(record, token, url) - personalisation = { + { name: record.name || record.email, email: record.email, organisation: record.respond_to?(:organisation) ? record.organisation.name : "", @@ -28,7 +28,7 @@ class DeviseNotifyMailer < Devise::Mailer send_email( record.email, record.reset_password_notify_template, - personalisation(record, token, url) + personalisation(record, token, url), ) end @@ -37,7 +37,7 @@ class DeviseNotifyMailer < Devise::Mailer send_email( record.email, record.confirmable_template, - personalisation(record, token, url) + personalisation(record, token, url), ) end diff --git a/app/models/user.rb b/app/models/user.rb index 9be892eff..3badcdd5d 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -66,7 +66,7 @@ class User < ApplicationRecord MFA_TEMPLATE_ID = "6bdf5ee1-8e01-4be1-b1f9-747061d8a24c".freeze RESET_PASSWORD_TEMPLATE_ID = "2c410c19-80a7-481c-a531-2bcb3264f8e6".freeze - CONFIRMABLE_TEMPLATE_ID = "257460a6-6616-4640-a3f9-17c3d73d9e91".freeze + CONFIRMABLE_TEMPLATE_ID = "257460a6-6616-4640-a3f9-17c3d73d9e91".freeze BETA_ONBOARDING_TEMPLATE_ID = "b48bc2cd-5887-4611-8296-d0ab3ed0e7fd".freeze def reset_password_notify_template