From 9563a586c27809898748c27f0c11b92d10456fda Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Sun, 7 May 2023 17:33:46 +0200 Subject: [PATCH] Appease the dog overlords (mostly) --- app/controllers/ajax/comment_controller.rb | 4 ++-- app/controllers/comment_controller.rb | 2 +- spec/views/answerbox/_comments.html.haml_spec.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/ajax/comment_controller.rb b/app/controllers/ajax/comment_controller.rb index c2ef3341..c7264464 100644 --- a/app/controllers/ajax/comment_controller.rb +++ b/app/controllers/ajax/comment_controller.rb @@ -14,12 +14,12 @@ class Ajax::CommentController < AjaxController return end - comments = Comment.where(answer:).includes([{user: :profile}, :smiles]) + comments = Comment.where(answer:).includes([{ user: :profile }, :smiles]) @response[:status] = :okay @response[:message] = t(".success") @response[:success] = true - @response[:render] = render_to_string(partial: 'answerbox/comments', locals: { a: answer, comments: }) + @response[:render] = render_to_string(partial: "answerbox/comments", locals: { a: answer, comments: }) @response[:count] = answer.comment_count end diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 0b61f2eb..d8b9ea6f 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -3,7 +3,7 @@ class CommentController < ApplicationController def index answer = Answer.find(params[:id]) - @comments = Comment.where(answer:).includes([{user: :profile}, :smiles]) + @comments = Comment.where(answer:).includes([{ user: :profile }, :smiles]) render "index", locals: { a: answer } end diff --git a/spec/views/answerbox/_comments.html.haml_spec.rb b/spec/views/answerbox/_comments.html.haml_spec.rb index 90090069..3af138d6 100644 --- a/spec/views/answerbox/_comments.html.haml_spec.rb +++ b/spec/views/answerbox/_comments.html.haml_spec.rb @@ -5,7 +5,7 @@ require "rails_helper" describe "answerbox/_comments.html.haml", type: :view do subject(:rendered) do render partial: "answerbox/comments", locals: { - comments:, a: + comments:, a:, } end