From a62e844a1a3928c7d8a31b0cdafe0d79e4ec29ca Mon Sep 17 00:00:00 2001 From: evazion Date: Fri, 16 Sep 2022 04:32:30 -0500 Subject: [PATCH] forum: fix visibility of forum post votes. Make all forum post votes visible to everyone. When forum votes were first introduced, it was technically possible to vote on any forum post, including on posts in mod-only threads. Accordingly, forum post votes were only visible if the forum post itself was visible. However, there doesn't actually exist any votes on private forum posts, and trying to filter them out makes the /user_actions page much slower, so just make them visible to everyone. --- app/models/forum_post_vote.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/forum_post_vote.rb b/app/models/forum_post_vote.rb index 07230da7e..b74381df1 100644 --- a/app/models/forum_post_vote.rb +++ b/app/models/forum_post_vote.rb @@ -14,7 +14,7 @@ class ForumPostVote < ApplicationRecord scope :excluding_user, ->(user_id) { where.not(creator_id: user_id) } def self.visible(user) - where(forum_post: ForumPost.visible(user)) + all end def self.forum_post_matches(params)