From 2357c75063623f25c86ab7ed0555100b2b25775d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 12 Apr 2025 13:09:49 +0200 Subject: [PATCH] Reads better with a verb first --- app/models/comment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 5818f72a9..393f38cb4 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -10,7 +10,7 @@ class Comment < ApplicationRecord # FIXME: Not a fan of this. Think all references to comment should come directly from the message. scope :belonging_to_card, ->(card) { joins(:message).where(messages: { card_id: card.id }) } - after_create_commit :creator_watches_card, :track_commenting_on_card + after_create_commit :watch_card_by_creator, :track_commenting_on_card before_destroy :cleanup_events def to_partial_path @@ -18,7 +18,7 @@ class Comment < ApplicationRecord end private - def creator_watches_card + def watch_card_by_creator card.watch_by creator end