strip out nil settings from config

This commit is contained in:
Sam 2013-12-20 19:12:08 +11:00
parent 95c4bf4cfa
commit bac2d21382
1 changed files with 3 additions and 1 deletions

View File

@ -33,7 +33,7 @@ Discourse::Application.configure do
config.i18n.fallbacks = true
if GlobalSetting.smtp_address
config.action_mailer.smtp_settings = {
settings = {
address: GlobalSetting.smtp_address,
port: GlobalSetting.smtp_port,
domain: GlobalSetting.smtp_domain,
@ -41,6 +41,8 @@ Discourse::Application.configure do
authentication: 'plain',
enable_starttls_auto: GlobalSetting.smtp_enable_start_tls
}
config.action_mailer.smtp_settings = settings.reject{|x,y| y.nil?}
else
config.action_mailer.delivery_method = :sendmail
config.action_mailer.sendmail_settings = {arguments: '-i'}