Favor after_create_commit to keep transactions fast
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user