FIX: Access the first post correctly

FIX: Access the first post correctly

topic.posts.first returns the post with the lowest id, which is not always the first post in the topic. topic.first_post is guaranteed to return the OP

diff --git a/app/jobs/concerns/alert_post_mixin.rb b/app/jobs/concerns/alert_post_mixin.rb
index b07f222..ebac4ec 100644
--- a/app/jobs/concerns/alert_post_mixin.rb
+++ b/app/jobs/concerns/alert_post_mixin.rb
@@ -139,12 +139,12 @@ module AlertPostMixin
   end
 
   def revise_topic(topic:, title:, raw:, datacenters:, firing: nil, high_priority: false)
-    post = topic.posts.first
+    post = topic.first_post
     title_changed = topic.title != title
     skip_revision = !title_changed
 
     if post.raw.strip != raw.strip || title_changed || !firing.nil?
-      post = topic.posts.first
+      post = topic.first_post
 
       fields = {
         title: title,

GitHub sha: 0f4204e0

1 Like