From a238f504e421a6e19934a4b8a0ef0d7012690ce7 Mon Sep 17 00:00:00 2001 From: Kevin McConnell Date: Tue, 25 Feb 2025 15:20:21 +0000 Subject: [PATCH] Don't create initial watches We have subscriptions instead now. Watches need only be created as necessary to override the defaults. --- app/models/bubble/watchable.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/app/models/bubble/watchable.rb b/app/models/bubble/watchable.rb index f1f97841e..4c5bdd4aa 100644 --- a/app/models/bubble/watchable.rb +++ b/app/models/bubble/watchable.rb @@ -3,8 +3,6 @@ module Bubble::Watchable included do has_many :watches, dependent: :destroy - - after_create :create_initial_watches end def watched_by?(user) @@ -19,9 +17,4 @@ module Bubble::Watchable User.where(id: bucket.subscribers.pluck(:id) + watches.watching.pluck(:user_id) - watches.not_watching.pluck(:user_id)) end - - private - def create_initial_watches - Watch.insert_all(bucket.users.pluck(:id).collect { |user_id| { user_id: user_id, bubble_id: id } }) - end end