FIX: active record 'joins' not supporting the array conditions.

FIX: active record ‘joins’ not supporting the array conditions.

diff --git a/jobs/scheduled/check_cakeday.rb b/jobs/scheduled/check_cakeday.rb
index be1015e..8e7704b 100644
--- a/jobs/scheduled/check_cakeday.rb
+++ b/jobs/scheduled/check_cakeday.rb
@@ -60,7 +60,7 @@ module Jobs
         .not_silenced
         .not_suspended
         .where(staged: false)
-        .joins("LEFT JOIN user_custom_fields f1 ON f1.user_id = users.id AND f1.name = ?", DevAdditions::CAKEDAY_NOTICE_CUSTOM_FIELD)
+        .joins("LEFT JOIN user_custom_fields f1 ON f1.user_id = users.id AND f1.name = '#{DevAdditions::CAKEDAY_NOTICE_CUSTOM_FIELD}'")
         .joins("LEFT JOIN topics t ON f1.value IS NOT NULL AND f1.value::int = t.id")
         .where("EXTRACT(DOY FROM users.created_at) BETWEEN ? AND ?", yday - 1, yday + 1)
         .where("t.id IS NULL OR (t.created_at < ?)", 10.days.ago)

GitHub sha: 8a3c80ce

2 Likes

Oh my … I hope we did not lose some stuff between cracks due to this… will have a look

1 Like

I checked it already. We didn’t miss anything in the last 8 days.

2 Likes