comments: allow admins to remove comment votes (fix #4640)
Allow admins to remove comment votes by other users. This is done by clicking the comment score to get to the comment vote list, then clicking the Remove button on every vote.
This commit is contained in:
@@ -26,8 +26,7 @@ class CommentVotesController < ApplicationController
|
||||
end
|
||||
|
||||
def destroy
|
||||
# XXX should find by comment vote id.
|
||||
@comment_vote = authorize CommentVote.active.find_by!(comment_id: params[:comment_id], user: CurrentUser.user)
|
||||
@comment_vote = authorize CommentVote.find(params[:id])
|
||||
@comment_vote.soft_delete(updater: CurrentUser.user)
|
||||
|
||||
respond_with(@comment_vote)
|
||||
|
||||
Reference in New Issue
Block a user