mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-02-13 21:33:20 +01:00
Prevent blocked users from reacting on comments
This commit is contained in:
parent
25ed1e4605
commit
e64d4f3ca7
1 changed files with 5 additions and 0 deletions
|
@ -142,6 +142,11 @@ class User < ApplicationRecord
|
|||
# smiles a comment
|
||||
# @param comment [Comment] the comment to smile
|
||||
def smile_comment(comment)
|
||||
# rubocop:disable Style/RedundantSelf
|
||||
raise Errors::ReactingSelfBlockedOther if self.blocking?(comment.user)
|
||||
raise Errors::ReactingOtherBlockedSelf if comment.user.blocking?(self)
|
||||
# rubocop:enable Style/RedundantSelf
|
||||
|
||||
CommentSmile.create!(user: self, comment: comment)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue