mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 16:20:42 +08:00
fixed a pile of notification craziness
addes some tests around post timings
This commit is contained in:
@ -27,8 +27,8 @@ class Notification < ActiveRecord::Base
|
||||
where(read: false)
|
||||
end
|
||||
|
||||
def self.mark_post_read(user, topic_id, post_number)
|
||||
Notification.update_all "read = true", ["user_id = ? and topic_id = ? and post_number = ?", user.id, topic_id, post_number]
|
||||
def self.mark_posts_read(user, topic_id, post_numbers)
|
||||
Notification.update_all "read = 't'", ["user_id = ? and topic_id = ? and post_number in (?) and read = ?", user.id, topic_id, post_numbers, false]
|
||||
end
|
||||
|
||||
def self.recent
|
||||
|
Reference in New Issue
Block a user