From 9ee5c50ca4e12aeec2cd21332d23e054ff28b810 Mon Sep 17 00:00:00 2001
From: ArtOfCode- <hello@artofcode.co.uk>
Date: Sat, 5 Aug 2023 12:21:05 +0100
Subject: [PATCH] Copy query change to next instance

---
 app/controllers/users_controller.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 1e3db9c72..fd8982b93 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -209,8 +209,8 @@ class UsersController < ApplicationController
                                                                     posts: { deleted: false })
             when 'edits'
               SuggestedEdit.where(user: @user) + \
-              PostHistory.joins(:post).where(user: @user, posts: { deleted: false },
-                                             post_history_type: PostHistoryType.find_by(name: 'post_edited'))
+              PostHistory.joins(:post, :post_history_type).where(user: @user, posts: { deleted: false },
+                                                                 post_history_types: { name: 'post_edited' })
             else
               Post.undeleted.where(user: @user) + \
               Comment.joins(:comment_thread, :post).undeleted.where(user: @user, comment_threads: { deleted: false },
-- 
GitLab