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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user