File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,7 +92,10 @@ def maximum_title_length
9292 # @param user [User] user to register as a follower
9393 # @return [Boolean] status of the operation
9494 def add_follower ( user )
95- return true if ThreadFollower . where ( comment_thread : self , user : user ) . any?
95+ if ThreadFollower . where ( comment_thread : self , user : user ) . any?
96+ bump_last_activity ( persist_changes : true )
97+ return true
98+ end
9699
97100 ThreadFollower . create ( comment_thread : self , user : user )
98101 end
@@ -111,7 +114,10 @@ def bump_last_activity(persist_changes: false)
111114 # @param user [User] user to remove from followers
112115 # @return [Boolean] status of the operation
113116 def remove_follower ( user )
114- return true if ThreadFollower . where ( comment_thread : self , user : user ) . none?
117+ if ThreadFollower . where ( comment_thread : self , user : user ) . none?
118+ bump_last_activity ( persist_changes : true )
119+ return true
120+ end
115121
116122 ThreadFollower . where ( comment_thread : self , user : user ) . destroy_all . any?
117123 end
You can’t perform that action at this time.
0 commit comments