Fix prune! affecting all users
This commit is contained in:
@@ -4,6 +4,6 @@ class ForumTopicVisit < ActiveRecord::Base
|
||||
attr_accessible :user_id, :user, :forum_topic_id, :forum_topic, :last_read_at
|
||||
|
||||
def self.prune!(user)
|
||||
where("last_read_at < ?", user.last_forum_read_at).delete_all
|
||||
where("user_id = ? and last_read_at < ?", user.id, user.last_forum_read_at).delete_all
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user