Changes initializer to avoid crash when migrating database from scratch

This commit is contained in:
kikito
2017-01-02 10:02:34 +01:00
parent 07a99b8e3f
commit 4adf32d582

View File

@@ -12,7 +12,7 @@ Devise.setup do |config|
# Configure the e-mail address which will be shown in Devise::Mailer,
# note that it will be overwritten if you use your own mailer class
# with default "from" parameter.
if Rails.env.test?
if Rails.env.test? || !ActiveRecord::Base.connection.table_exists?('settings')
config.mailer_sender = "noreply@example.org"
else
config.mailer_sender = "#{Setting['mailer_from_name']} <#{Setting['mailer_from_address']}>"