From d8fd7ca12486971317b8c6dd3a105b8473cdd07d Mon Sep 17 00:00:00 2001 From: miteruzo Date: Tue, 12 Aug 2025 00:16:21 +0900 Subject: [PATCH] #5 --- backend/app/controllers/thread_posts_controller.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/app/controllers/thread_posts_controller.rb b/backend/app/controllers/thread_posts_controller.rb index d17340e..914c9c6 100644 --- a/backend/app/controllers/thread_posts_controller.rb +++ b/backend/app/controllers/thread_posts_controller.rb @@ -24,6 +24,9 @@ class ThreadPostsController < ApplicationController def create post = @thread.posts.new(post_params) if post.save + post.thread.tap { |thread| + thread.updated_at = post.created_at + }.save! render json: post.as_json.merge(image_url: ( if post.image.attached? Rails.application.routes.url_helpers.rails_blob_url(post.image, only_path: true)