mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
fix regression in visible notification detection
This commit is contained in:
@@ -9,7 +9,8 @@ class Notification < ActiveRecord::Base
|
||||
|
||||
scope :unread, lambda { where(read: false) }
|
||||
scope :recent, lambda { |n=nil| n ||= 10; order('notifications.created_at desc').limit(n) }
|
||||
scope :visible , lambda { joins('LEFT JOIN topics ON notifications.topic_id = topics.id AND topics.deleted_at IS NULL') }
|
||||
scope :visible , lambda { joins('LEFT JOIN topics ON notifications.topic_id = topics.id')
|
||||
.where('topics.id IS NULL OR topics.deleted_at IS NULL') }
|
||||
|
||||
after_save :refresh_notification_count
|
||||
after_destroy :refresh_notification_count
|
||||
|
||||
Reference in New Issue
Block a user