FIX: Update all does not trigger callbacks.

This commit is contained in:
Guo Xiang Tan
2015-12-16 23:44:52 +08:00
parent 36fa57f145
commit cca0896b9e
2 changed files with 2 additions and 1 deletions

View File

@ -36,6 +36,7 @@ class Notification < ActiveRecord::Base
def self.mark_posts_read(user, topic_id, post_numbers)
Notification.where(user_id: user.id, topic_id: topic_id, post_number: post_numbers, read: false).update_all "read = 't'"
user.publish_notifications_state
end
def self.interesting_after(min_date)