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.
This commit is contained in:
evazion
2022-09-16 04:32:30 -05:00
parent bd73090b4c
commit a62e844a1a

View File

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