diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index e7bcb5612..c697b9bbd 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -96,7 +96,7 @@ class ArticlesController < ApplicationController handle_org_assignment handle_hiring_tag if @article.published - Notification.send_all(@article, "Published") if @article.previous_changes.include?("published_at") + Notification.send_all(@article, "Published") if @article.previous_changes.include?("published") path = @article.path else Notification.remove_all(@article, "Published") diff --git a/app/models/comment.rb b/app/models/comment.rb index 1f74b6918..91e985dfd 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -171,6 +171,7 @@ class Comment < ApplicationRecord end def remove_from_feed + super if ancestors.empty? && user != commentable.user [User.find(commentable.user.id)&.touch(:last_notification_activity)] elsif ancestors diff --git a/app/models/follow.rb b/app/models/follow.rb index c229b387e..7efd582ef 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -45,6 +45,7 @@ class Follow < ApplicationRecord end def remove_from_feed + super if followable_type == "User" User.find(followable.id)&.touch(:last_notification_activity) end diff --git a/app/models/mention.rb b/app/models/mention.rb index 3516d6595..de3df633d 100644 --- a/app/models/mention.rb +++ b/app/models/mention.rb @@ -60,6 +60,7 @@ class Mention < ApplicationRecord end def remove_from_feed + super User.find(user.id)&.touch(:last_notification_activity) end diff --git a/app/models/notification.rb b/app/models/notification.rb index 1a60e36a4..8762b8831 100644 --- a/app/models/notification.rb +++ b/app/models/notification.rb @@ -72,6 +72,7 @@ class Notification < ApplicationRecord end def remove_from_feed + super User.find(user_id)&.touch(:last_notification_activity) end diff --git a/app/models/reaction.rb b/app/models/reaction.rb index 337e906c3..2935117c8 100644 --- a/app/models/reaction.rb +++ b/app/models/reaction.rb @@ -55,6 +55,7 @@ class Reaction < ApplicationRecord end def remove_from_feed + super User.find(reactable.user.id)&.touch(:last_notification_activity) end