From bdc4004e4a3e1a081053702151143bc2adc57600 Mon Sep 17 00:00:00 2001 From: Riccardo Graziosi <31478034+riggraz@users.noreply.github.com> Date: Sat, 16 Jul 2022 12:36:33 +0200 Subject: [PATCH] Fix mail delivery error in production (#132) Fix issue #62 --- app/models/user.rb | 3 ++- config/environments/production.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/models/user.rb b/app/models/user.rb index eb7a2fd1..90270746 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,7 +12,8 @@ class User < ApplicationRecord after_initialize :set_default_role, if: :new_record? after_initialize :set_default_status, if: :new_record? - after_initialize :skip_confirmation, if: :new_record? + + before_save :skip_confirmation validates :full_name, presence: true, length: { in: 2..32 } diff --git a/config/environments/production.rb b/config/environments/production.rb index 1fb3ae60..8f0081fb 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -64,7 +64,7 @@ Rails.application.configure do # Ignore bad email addresses and do not raise email delivery errors. # Set this to true and configure the email server for immediate delivery to raise delivery errors. - # config.action_mailer.raise_delivery_errors = false + config.action_mailer.raise_delivery_errors = false # Enable locale fallbacks for I18n (makes lookups for any locale fall back to # the I18n.default_locale when a translation cannot be found).