A platform for community discussion. Free, open, simple.
FIX: FIX: Use `bumped_at` instead of `updated_at` for `TopicQuery#apply_max_age_limit` (#40127)
Mark VanLandingham17555ae8798e
diff --git a/lib/topic_query.rb b/lib/topic_query.rbindex 60511264ae9..c1c19ae2a98 100644--- a/lib/topic_query.rb+++ b/lib/topic_query.rb@@ -1338,7 +1338,7 @@ class TopicQuery# perf note, in the past we tried doing this in a subquery but performance was# terrible, also tried with a join and it was bad- results = results.where("topics.updated_at >= ?", unread_at)+ results = results.where("topics.bumped_at >= ?", unread_at)endresultsenddiff --git a/spec/lib/topic_query_spec.rb b/spec/lib/topic_query_spec.rbindex 8f0545c73a2..cf984ededa2 100644--- a/spec/lib/topic_query_spec.rb+++ b/spec/lib/topic_query_spec.rb@@ -1921,8 +1921,8 @@ RSpec.describe TopicQuery dofully_read_archived.archived = truefully_read_archived.save- old_partially_read.update!(updated_at: 2.weeks.ago)- partially_read.update!(updated_at: Time.now)+ old_partially_read.update!(bumped_at: 2.weeks.ago)+ partially_read.update!(bumped_at: Time.now)endit "operates correctly" do