Favor after_create_commit to keep transactions fast

This commit is contained in:
Jorge Manrubia
2025-04-23 15:28:28 +02:00
parent ea66845e71
commit 53eba9bd0b
+1 -1
View File
@@ -5,7 +5,7 @@ class Mention < ApplicationRecord
belongs_to :mentioner, class_name: "User"
belongs_to :mentionee, class_name: "User", inverse_of: :mentions
after_create :add_mentionee_as_watcher
after_create_commit :add_mentionee_as_watcher
def self_mention?
mentioner == mentionee