Not using the destroy callback
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user