From be1754e16a6a0d785312fd09329753ee1eff24df Mon Sep 17 00:00:00 2001 From: "Scott D. Sullivan" Date: Tue, 27 Jan 2015 23:13:36 +0000 Subject: [PATCH] 3747: Pass in ID instead of User and Work Objects --- app/controllers/admin/user_creations_controller.rb | 2 +- app/mailers/user_mailer.rb | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/controllers/admin/user_creations_controller.rb b/app/controllers/admin/user_creations_controller.rb index 9b1f1d7a13d..21e182b9637 100644 --- a/app/controllers/admin/user_creations_controller.rb +++ b/app/controllers/admin/user_creations_controller.rb @@ -23,7 +23,7 @@ def hide users = creation.pseuds.map(&:user).uniq users.each do |user| unless user == orphan_account - UserMailer.admin_hidden_work_notification(creation, user).deliver + UserMailer.admin_hidden_work_notification(creation.id, user.id).deliver end end redirect_to(creation) diff --git a/app/mailers/user_mailer.rb b/app/mailers/user_mailer.rb index 593cf8c34f0..d619b4c1663 100644 --- a/app/mailers/user_mailer.rb +++ b/app/mailers/user_mailer.rb @@ -294,12 +294,12 @@ def admin_deleted_work_notification(user, work) end # Sends email to authors when a creation is hidden by an Admin - def admin_hidden_work_notification(creation, user) - @user = user - @work = creation + def admin_hidden_work_notification(creation_id, user_id) + @user = User.find_by_id(user_id) + @work = Work.find_by_id(creation_id) mail( - to: user.email, + to: @user.email, subject: "[#{ArchiveConfig.APP_SHORT_NAME}] Your work has been hidden by the Abuse Team" ) end