Fix: visible_post_types expects a user

This commit is contained in:
Joffrey JAFFEUX 2024-12-13 16:57:40 +01:00
parent 589d2e9761
commit df21bc6e73

View File

@ -75,7 +75,7 @@ module DiscourseRewind
.includes(:topic) .includes(:topic)
.where( .where(
"posts.post_type IN (?)", "posts.post_type IN (?)",
Topic.visible_post_types(user.guardian, include_moderator_actions: false), Topic.visible_post_types(user, include_moderator_actions: false),
) )
.joins( .joins(
"INNER JOIN posts replies ON posts.topic_id = replies.topic_id AND posts.reply_to_post_number = replies.post_number", "INNER JOIN posts replies ON posts.topic_id = replies.topic_id AND posts.reply_to_post_number = replies.post_number",