From: Ward Vandewege Date: Fri, 25 Apr 2014 14:25:49 +0000 (-0400) Subject: Fix AdminNotifier, bitrot after upgrade to Ruby 2.x and Rails 3.x. X-Git-Tag: 1.1.0~2575^2~17^2~11 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/6e0751ce5ea7332fc87e7836c24b6ccb49c399dc Fix AdminNotifier, bitrot after upgrade to Ruby 2.x and Rails 3.x. --- diff --git a/services/api/app/mailers/admin_notifier.rb b/services/api/app/mailers/admin_notifier.rb index d291e86f9a..827ff7edc9 100644 --- a/services/api/app/mailers/admin_notifier.rb +++ b/services/api/app/mailers/admin_notifier.rb @@ -16,7 +16,7 @@ class AdminNotifier < ActionMailer::Base def generic_callback(callback_type, model, *args) model_specific_method = "#{callback_type}_#{model.class.to_s.underscore}".to_sym - if self.respond_to? model_specific_method + if self.respond_to?(model_specific_method,true) self.send model_specific_method, model, *args end end @@ -32,10 +32,11 @@ class AdminNotifier < ActionMailer::Base def after_create_user(user, *args) @new_user = user + @recipients = self.all_admin_emails logger.info "Sending mail to #{@recipients} about new user #{@new_user.uuid} (#{@new_user.full_name}, #{@new_user.email})" - mail({ - to: self.all_admin_emails, - subject: "#{Rails.configuration.email_subject_prefix}New user: #{@new_user.full_name}, #{@new_user.email}" - }) + mail(template_name: __method__, + to: @recipients, + subject: "#{Rails.configuration.email_subject_prefix}New user: #{@new_user.full_name}, #{@new_user.email}" + ).deliver end end