/comment_votes: make visible to banned users.

Let banned users see their own comment votes.
This commit is contained in:
evazion
2020-02-16 03:24:21 -06:00
parent a214989447
commit bbabaffb07
2 changed files with 9 additions and 5 deletions

View File

@@ -1,11 +1,11 @@
class CommentVotesController < ApplicationController
before_action :member_only
before_action :member_only, except: [:index]
skip_before_action :api_check
respond_to :js, :json, :xml, :html
rescue_with CommentVote::Error, ActiveRecord::RecordInvalid, status: 422
def index
@comment_votes = CommentVote.paginated_search(params, count_pages: true)
@comment_votes = CommentVote.visible(CurrentUser.user).paginated_search(params, count_pages: true)
@comment_votes = @comment_votes.includes(:user, comment: [:creator, post: [:uploader]]) if request.format.html?
respond_with(@comment_votes)
end