From 63c05220ce38ae67255d166df4e73d73d426deea Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 12 Apr 2025 11:09:55 +0200 Subject: [PATCH] Clearer naming --- app/controllers/cards/comments/reactions_controller.rb | 2 +- app/controllers/cards/comments_controller.rb | 2 +- app/models/comment.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/cards/comments/reactions_controller.rb b/app/controllers/cards/comments/reactions_controller.rb index 9c47b5eb8..fb0c4fa55 100644 --- a/app/controllers/cards/comments/reactions_controller.rb +++ b/app/controllers/cards/comments/reactions_controller.rb @@ -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) diff --git a/app/controllers/cards/comments_controller.rb b/app/controllers/cards/comments_controller.rb index c7da8c568..35f8e13e7 100644 --- a/app/controllers/cards/comments_controller.rb +++ b/app/controllers/cards/comments_controller.rb @@ -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 diff --git a/app/models/comment.rb b/app/models/comment.rb index ff223b5c6..1eb286454 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -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