FIX: Compare Jobs::UserEmail type argument as string ()

In specs, symbols are passed through correctly. But in production, all arguments are provided to jobs as strings.

Followup to c0293339b87c39bbd2b91f87e2d39179f40c9a9a
This commit is contained in:
David Taylor 2020-10-07 16:55:32 +01:00 committed by GitHub
parent 71d37953d5
commit 16daf3c986
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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