FIX: searching email logs by reply key (#6868)

FIX: searching email logs by reply key (#6868)

  • you can’t use LIKE or ILIKE on a UUID
diff --git a/app/controllers/admin/email_controller.rb b/app/controllers/admin/email_controller.rb
index 04b015b..476f0af 100644
--- a/app/controllers/admin/email_controller.rb
+++ b/app/controllers/admin/email_controller.rb
@@ -32,7 +32,7 @@ class Admin::EmailController < Admin::AdminController
 
     if params[:reply_key].present?
       email_logs = email_logs.where(
-        "post_reply_keys.reply_key ILIKE ?", "%#{params[:reply_key]}%"
+        "CAST (post_reply_keys.reply_key AS VARCHAR) ILIKE ?", "%#{params[:reply_key]}%"
       )
     end

GitHub sha: c85b9c6e

FIX: Partial reply key search in email sent logs.