Skip to content
Snippets Groups Projects
Unverified Commit 1bca81ca authored by ArtOfCode's avatar ArtOfCode Committed by GitHub
Browse files

Merge pull request #1153 from sau226dev/sau226/history-remove-initialrev

parents 068fe5c3 af244f8f
Branches
Tags
2 merge requests!51Upgrade to latest qpixel,!50Update to latest codidact changes
......@@ -196,7 +196,8 @@ class UsersController < ApplicationController
@comments = Comment.joins(:comment_thread, :post).undeleted.where(user: @user, comment_threads: { deleted: false },
posts: { deleted: false }).count
@suggested_edits = SuggestedEdit.where(user: @user).count
@edits = PostHistory.joins(:post).where(user: @user, posts: { deleted: false }).count
@edits = PostHistory.joins(:post, :post_history_type).where(user: @user, posts: { deleted: false },
post_history_types: { name: 'post_edited' }).count
@all_edits = @suggested_edits + @edits
......@@ -208,7 +209,8 @@ class UsersController < ApplicationController
posts: { deleted: false })
when 'edits'
SuggestedEdit.where(user: @user) + \
PostHistory.joins(:post).where(user: @user, posts: { deleted: false })
PostHistory.joins(:post).where(user: @user, posts: { deleted: false },
post_history_type: PostHistoryType.find_by(name: 'post_edited'))
else
Post.undeleted.where(user: @user) + \
Comment.joins(:comment_thread, :post).undeleted.where(user: @user, comment_threads: { deleted: false },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment