Skip to content

A platform for community discussion. Free, open, simple.

FIX: add table name to topic view query (#10052)

Krzysztof Kotlarekdcb816b54811
diff --git a/lib/topic_view.rb b/lib/topic_view.rb
index 42405f8e337..0ab7c7f060c 100644
--- a/lib/topic_view.rb
+++ b/lib/topic_view.rb
@@ -546,7 +546,7 @@ class TopicView
columns = [:id]
if !is_mega_topic?
- columns << 'EXTRACT(DAYS FROM CURRENT_TIMESTAMP - created_at)::INT AS days_ago'
+ columns << 'EXTRACT(DAYS FROM CURRENT_TIMESTAMP - posts.created_at)::INT AS days_ago'
end
posts.pluck(*columns)