From 7e3163c0d09dc11245545caae4a7fc8bd6900fc0 Mon Sep 17 00:00:00 2001 From: Godwin Date: Tue, 7 Jun 2016 21:06:02 -0700 Subject: [PATCH] Fixed error in user_mailer --- app/mailers/user_mailer.rb | 6 +++--- config/initializers/delayed_job_config.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 config/initializers/delayed_job_config.rb diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 5031fd6..f52e6d0 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -171,11 +171,11 @@ class UserMailer < ActionMailer::Base end private - def set_host + def set_host(*args) if Rails.env.production? - @host = "https://#{I18n.location.to_s}.bikebike.org" + @host = "https://#{I18n.locale.to_s}.bikebike.org" elsif Rails.env.preview? - @host = "https://preview-#{I18n.location.to_s}.bikebike.org" + @host = "https://preview-#{I18n.locale.to_s}.bikebike.org" else @host = UserMailer.default_url_options[:host] end diff --git a/config/initializers/delayed_job_config.rb b/config/initializers/delayed_job_config.rb new file mode 100644 index 0000000..5fb7655 --- /dev/null +++ b/config/initializers/delayed_job_config.rb @@ -0,0 +1 @@ +Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))