From b7d92b7ddd55f2f4c4f861402e12f5deae7c93a9 Mon Sep 17 00:00:00 2001 From: Codex Night Worker Date: Fri, 13 Nov 2026 12:25:24 +0900 Subject: [PATCH] AI: address issue #439 --- backend/app/controllers/posts_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/app/controllers/posts_controller.rb b/backend/app/controllers/posts_controller.rb index ba15e99..bf54551 100644 --- a/backend/app/controllers/posts_controller.rb +++ b/backend/app/controllers/posts_controller.rb @@ -314,7 +314,9 @@ class PostsController < ApplicationController def viewed return head :unauthorized unless current_user - current_user.viewed_posts << Post.find(params[:id]) + UserPostView.create_or_find_by!( + user: current_user, + post: Post.find(params[:id])) head :no_content end