Clearer naming
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user