mirror of
https://github.com/discourse/discourse.git
synced 2025-02-06 03:18:23 +00:00
FIX: add table name to topic view query (#10052)
When plugin is hooking into TopicView joining other tables, it may fail because `created_at` is potentially available on 2 tables. Therefore we should explicitly define which `created_at` we want.
This commit is contained in:
parent
b62ad003ce
commit
dcb816b548
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user