From e1f03fb8fd331f9c4c9e4fd70d1277d6b32f3434 Mon Sep 17 00:00:00 2001 From: Jose Farias Date: Wed, 23 Oct 2024 19:13:35 -0600 Subject: [PATCH] comment! -> comment --- app/controllers/comments_controller.rb | 2 +- app/models/bubble/commentable.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/comments_controller.rb b/app/controllers/comments_controller.rb index 052433989..83fbb1e80 100644 --- a/app/controllers/comments_controller.rb +++ b/app/controllers/comments_controller.rb @@ -2,7 +2,7 @@ class CommentsController < ApplicationController include BubbleScoped, BucketScoped def create - @bubble.comment! params.require(:comment).expect(:body) + @bubble.comment params.require(:comment).expect(:body) redirect_to @bubble end end diff --git a/app/models/bubble/commentable.rb b/app/models/bubble/commentable.rb index dce3f8602..adc9626b1 100644 --- a/app/models/bubble/commentable.rb +++ b/app/models/bubble/commentable.rb @@ -7,7 +7,7 @@ module Bubble::Commentable scope :ordered_by_comments, -> { left_joins(:comments).group(:id).order("COUNT(comments.id) DESC") } end - def comment!(body) + def comment(body) thread_entries.create! threadable: Comment.new(body: body, bubble: self) end end