Skip to content

Commit 74eaa4c

Browse files
committed
CommentThread#remove_follower should remove all followers
1 parent 18142a4 commit 74eaa4c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Naming/BlockForwarding:
5858
EnforcedStyle: explicit
5959
Naming/PredicateMethod:
6060
Mode: conservative
61-
AllowedPatterns: ['verify_.*', 'check_.*', 'enforce_.*', 'setup_.*']
61+
AllowedPatterns: ['verify_.*', 'check_.*', 'enforce_.*', 'setup_.*','add_.*', 'remove_.*']
6262
AllowedMethods:
6363
- post_sign_in # returns a boolean but is a necessary after-sign-in method for both normal and SAML flows
6464
- comment_rate_limited? # returns a tuple with the boolean as the first value

app/models/comment_thread.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def bump_last_activity(persist_changes: false)
109109
# @param user [User] user to remove from followers
110110
# @return [Boolean] status of the operation
111111
def remove_follower(user)
112-
ThreadFollower.find_by(comment_thread: self, user: user)&.destroy || false
112+
ThreadFollower.where(comment_thread: self, user: user).destroy_all.any?
113113
end
114114

115115
private

0 commit comments

Comments
 (0)