Clearer naming

This commit is contained in:
David Heinemeier Hansson
2025-04-12 11:09:55 +02:00
parent ecffdc2af4
commit 63c05220ce
3 changed files with 3 additions and 3 deletions
@@ -25,7 +25,7 @@ class Cards::Comments::ReactionsController < ApplicationController
private
def set_comment
@comment = Comment.via_card(@card).find(params[:comment_id])
@comment = Comment.belonging_to_card(@card).find(params[:comment_id])
end
def broadcast_create(reaction)
+1 -1
View File
@@ -25,7 +25,7 @@ class Cards::CommentsController < ApplicationController
private
def set_comment
@comment = Comment.via_card(@card).find(params[:id])
@comment = Comment.belonging_to_card(@card).find(params[:id])
@message = @comment.message
end
+1 -1
View File
@@ -7,7 +7,7 @@ class Comment < ApplicationRecord
has_markdown :body
searchable_by :body_plain_text, using: :comments_search_index, as: :body
scope :via_card, ->(card) { joins(:message).where(messages: { card_id: card.id }) }
scope :belonging_to_card, ->(card) { joins(:message).where(messages: { card_id: card.id }) }
before_destroy :cleanup_events