Browse Source

Rubocop

pull/580/head
baarkerlounger 3 years ago
parent
commit
2410f5d0f8
  1. 5
      app/controllers/auth/confirmations_controller.rb
  2. 6
      app/mailers/devise_notify_mailer.rb
  3. 2
      app/models/user.rb

5
app/controllers/auth/confirmations_controller.rb

@ -1,5 +1,4 @@
class Auth::ConfirmationsController < Devise::ConfirmationsController class Auth::ConfirmationsController < Devise::ConfirmationsController
# GET /resource/confirmation?confirmation_token=abcdef # GET /resource/confirmation?confirmation_token=abcdef
def show def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token]) 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}" url = "#{base}?reset_password_token=#{token}"
redirect_to url redirect_to url
else 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 end
else else
respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new } respond_with_navigational(resource.errors, status: :unprocessable_entity) { render :new }
end end
end end
end end

6
app/mailers/devise_notify_mailer.rb

@ -14,7 +14,7 @@ class DeviseNotifyMailer < Devise::Mailer
end end
def personalisation(record, token, url) def personalisation(record, token, url)
personalisation = { {
name: record.name || record.email, name: record.name || record.email,
email: record.email, email: record.email,
organisation: record.respond_to?(:organisation) ? record.organisation.name : "", organisation: record.respond_to?(:organisation) ? record.organisation.name : "",
@ -28,7 +28,7 @@ class DeviseNotifyMailer < Devise::Mailer
send_email( send_email(
record.email, record.email,
record.reset_password_notify_template, record.reset_password_notify_template,
personalisation(record, token, url) personalisation(record, token, url),
) )
end end
@ -37,7 +37,7 @@ class DeviseNotifyMailer < Devise::Mailer
send_email( send_email(
record.email, record.email,
record.confirmable_template, record.confirmable_template,
personalisation(record, token, url) personalisation(record, token, url),
) )
end end

2
app/models/user.rb

@ -66,7 +66,7 @@ class User < ApplicationRecord
MFA_TEMPLATE_ID = "6bdf5ee1-8e01-4be1-b1f9-747061d8a24c".freeze MFA_TEMPLATE_ID = "6bdf5ee1-8e01-4be1-b1f9-747061d8a24c".freeze
RESET_PASSWORD_TEMPLATE_ID = "2c410c19-80a7-481c-a531-2bcb3264f8e6".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 BETA_ONBOARDING_TEMPLATE_ID = "b48bc2cd-5887-4611-8296-d0ab3ed0e7fd".freeze
def reset_password_notify_template def reset_password_notify_template

Loading…
Cancel
Save