We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c6ee10 commit 08dab30Copy full SHA for 08dab30
1 file changed
app/controllers/users_controller.rb
@@ -50,11 +50,7 @@ def show
50
@posts = set_posts.user_sort({ term: params[:sort], default: :score },
51
age: :created_at, score: :score)
52
53
- @total_post_count = if @user == current_user
54
- @user.posts.undeleted.count
55
- else
56
- @user.posts.count
57
- end
+ @total_post_count = Post.all.by(@user).count
58
@posts = @posts.first(@limit)
59
render layout: 'without_sidebar'
60
end
0 commit comments