Skip to content

Commit 8096d5d

Browse files
committed
fix SyncDestroy action policy to be run on before_destroy
1 parent acfe815 commit 8096d5d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/stream_rails/sync_policies.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def add_to_feed
2828

2929
module SyncDestroy
3030
def self.included(base)
31-
if base.respond_to? :after_commit
32-
base.after_commit :remove_from_feed, on: :destroy
31+
if base.respond_to? :before_destroy
32+
base.before_destroy :remove_from_feed
3333
elsif Object.const_defined?('Sequel') && base < Sequel::Model
3434
base.instance_eval do
3535
define_method(:before_destroy) do |*args|

0 commit comments

Comments
 (0)