Use symbols instead of strings for SMTP settings

ActionMailer does differenciate between symbols and strings, and the
code stringifying keys comes from an early version which we forgot to
remove.
This commit is contained in:
Javi Martín
2019-12-01 20:30:45 +01:00
parent 11adacfdb9
commit 1910115469
2 changed files with 26 additions and 26 deletions

View File

@@ -32,15 +32,15 @@ test:
staging:
secret_key_base: ""
server_name: ""
# mailer_delivery_method: "smtp"
# mailer_delivery_method: :smtp
# smtp_settings:
# address: "smtp.example.com"
# port: 25
# domain: "your_domain.com"
# user_name: "<username>"
# password: "<password>"
# authentication: "plain"
# enable_starttls_auto: true
# :address: "smtp.example.com"
# :port: 25
# :domain: "your_domain.com"
# :user_name: "<username>"
# :password: "<password>"
# :authentication: "plain"
# :enable_starttls_auto: true
force_ssl: true
delay_jobs: true
rollbar_server_token: ""
@@ -55,15 +55,15 @@ staging:
preproduction:
secret_key_base: ""
server_name: ""
# mailer_delivery_method: "smtp"
# mailer_delivery_method: :smtp
# smtp_settings:
# address: "smtp.example.com"
# port: 25
# domain: "your_domain.com"
# user_name: "<username>"
# password: "<password>"
# authentication: "plain"
# enable_starttls_auto: true
# :address: "smtp.example.com"
# :port: 25
# :domain: "your_domain.com"
# :user_name: "<username>"
# :password: "<password>"
# :authentication: "plain"
# :enable_starttls_auto: true
force_ssl: true
delay_jobs: true
rollbar_server_token: ""
@@ -83,15 +83,15 @@ preproduction:
production:
secret_key_base: ""
server_name: ""
# mailer_delivery_method: "smtp"
# mailer_delivery_method: :smtp
# smtp_settings:
# address: "smtp.example.com"
# port: 25
# domain: "your_domain.com"
# user_name: "<username>"
# password: "<password>"
# authentication: "plain"
# enable_starttls_auto: true
# :address: "smtp.example.com"
# :port: 25
# :domain: "your_domain.com"
# :user_name: "<username>"
# :password: "<password>"
# :authentication: "plain"
# :enable_starttls_auto: true
force_ssl: true
delay_jobs: true
rollbar_server_token: ""

View File

@@ -2,8 +2,8 @@ namespace :secrets do
desc "Add SMTP, SSL and delay jobs settings to secrets.yml"
task smtp_ssl_and_delay_jobs: :environment do
current_settings = {
"mailer_delivery_method" => ActionMailer::Base.delivery_method.to_s,
"smtp_settings" => ActionMailer::Base.smtp_settings.stringify_keys,
"mailer_delivery_method" => ActionMailer::Base.delivery_method,
"smtp_settings" => ActionMailer::Base.smtp_settings,
"force_ssl" => Rails.application.config.force_ssl,
"delay_jobs" => Delayed::Worker.delay_jobs
}