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:
Krzysztof Kotlarek 2020-06-17 10:40:01 +10:00 committed by GitHub
parent b62ad003ce
commit dcb816b548
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -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)