Not using the destroy callback

This commit is contained in:
David Heinemeier Hansson
2025-04-12 11:11:30 +02:00
parent 63c05220ce
commit 1c4e0d3ccc
2 changed files with 1 additions and 6 deletions
-4
View File
@@ -11,8 +11,4 @@ module Messageable
def created_via_message
# Overwrite in Messageable class
end
def destroyed_via_message
# Overwrite in Messageable class
end
end
+1 -2
View File
@@ -5,6 +5,5 @@ class Message < ApplicationRecord
scope :chronologically, -> { order created_at: :asc, id: :desc }
after_create -> { messageable.created_via_message }
after_destroy -> { messageable.destroyed_via_message }
after_create -> { messageable.created_via_message }
end