users: remove 'hide deleted posts' account setting.

This setting automatically added the `-status:deleted` metatag to all searches. This meant deleted
posts were filtered out at the database level, rather than at the html level. This way searches
wouldn't have less-than-full pages.

The cost was that searches were slower, mainly because post counts weren't cached. Normally when you
search for a tag, we can get the post count from the tags table. If the search is actually like
`touhou -status:deleted`, then we don't know the count and we have to calculate it on demand.

This option is being removed because it did the opposite of what people thought it did. People
thought it made deleted posts visible, when actually it made them more hidden.
This commit is contained in:
evazion
2022-04-30 20:54:29 -05:00
parent fdc1130aea
commit f117049750
10 changed files with 17 additions and 73 deletions

View File

@@ -413,18 +413,6 @@ class PostsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
assert_select "#post_#{@post.id}", 1
end
context "with the hide_deleted_posts option enabled" do
should "show deleted posts when searching for status:appealed" do
@user.update!(hide_deleted_posts: true)
create(:post_appeal, post: @post)
get_auth posts_path(tags: "status:appealed"), @user
assert_response :success
assert_select "#post_#{@post.id}", 1
end
end
end
context "with restricted posts" do