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 @@ def activity 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 },