comments: show "undo vote" link by default on voted comments (fix #4143).

This commit is contained in:
evazion
2019-08-20 21:17:02 -05:00
parent 6e708dec18
commit 2cf929ad6e
6 changed files with 49 additions and 27 deletions
+4 -4
View File
@@ -167,14 +167,14 @@ class Comment < ApplicationRecord
end
end
def below_threshold?(user = CurrentUser.user)
score < user.comment_threshold
end
def editable_by?(user)
creator_id == user.id || user.is_moderator?
end
def voted_by?(user)
user.id.in?(votes.map(&:user_id))
end
def hidden_attributes
super + [:body_index]
end