A platform for community discussion. Free, open, simple.
DEV: Remove deprecated User#saw_notification_id method (#27175)
Ted Johanssoncb592ae4ac17
diff --git a/app/models/user.rb b/app/models/user.rbindex b588fc5c75b..9e1f1e502b9 100644--- a/app/models/user.rb+++ b/app/models/user.rb@@ -788,18 +788,6 @@ class User < ActiveRecord::BaseReviewable.list_for(self, include_claimed_by_others: false).countend- def saw_notification_id(notification_id)- Discourse.deprecate(<<~TEXT, since: "2.9", drop_from: "3.0")- User#saw_notification_id is deprecated. Please use User#bump_last_seen_notification! instead.- TEXT- if seen_notification_id.to_i < notification_id.to_i- update_columns(seen_notification_id: notification_id.to_i)- true- else- false- end- end-def bump_last_seen_notification!query = self.notifications.visiblequery = query.where("notifications.id > ?", seen_notification_id) if seen_notification_iddiff --git a/plugins/discourse-narrative-bot/plugin.rb b/plugins/discourse-narrative-bot/plugin.rbindex 6e15b802081..fceda47e80b 100644--- a/plugins/discourse-narrative-bot/plugin.rb+++ b/plugins/discourse-narrative-bot/plugin.rb@@ -114,7 +114,6 @@ after_initialize donotification = Notification.where(topic_id: topic.id, post_number: first_post.post_number).firstif notification.present?Notification.read(self, notification.id)- self.saw_notification_id(notification.id)self.reloadself.publish_notifications_stateend