Fix saved searces, news updates, ip bans being dumped to BigQuery.
Prevent saved searches, news updates, and ip bans from being publicly dumped to BigQuery. They didn't override the `visible` method to restrict their visibility for anonymous users.
This commit is contained in:
@@ -2,6 +2,14 @@ class ForumTopicVisit < ApplicationRecord
|
||||
belongs_to :user
|
||||
belongs_to :forum_topic
|
||||
|
||||
def self.visible(user)
|
||||
if user.is_owner?
|
||||
all
|
||||
else
|
||||
where(user: user)
|
||||
end
|
||||
end
|
||||
|
||||
def self.prune!(user)
|
||||
where("user_id = ? and last_read_at < ?", user.id, user.last_forum_read_at).delete_all
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user