From 16daf3c986cf98318bf8cb7d3a1aef3aae3ce4a2 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 7 Oct 2020 16:55:32 +0100 Subject: [PATCH] FIX: Compare Jobs::UserEmail type argument as string (#10851) In specs, symbols are passed through correctly. But in production, all arguments are provided to jobs as strings. Followup to c0293339b87c39bbd2b91f87e2d39179f40c9a9a --- app/jobs/regular/user_email.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/jobs/regular/user_email.rb b/app/jobs/regular/user_email.rb index 191d16c13c..4c1e3c3ccb 100644 --- a/app/jobs/regular/user_email.rb +++ b/app/jobs/regular/user_email.rb @@ -24,7 +24,7 @@ module Jobs send_user_email(args) - if args[:user_id].present? && args[:type] == :digest + if args[:user_id].present? && args[:type].to_s == "digest" # Record every attempt at sending a digest email, even if it was skipped UserStat.where(user_id: args[:user_id]).update_all(digest_attempted_at: Time.zone.now) end