Fix #4951: chartags:0 returning posts with chartags.

* Add fix script to fix posts with incorrect tag_count_* fields.
* Simplify the code for updating tag_count_* fields (no functional change).
This commit is contained in:
evazion
2022-01-10 13:22:08 -06:00
parent bd7018a3ae
commit 2e1c7ce6d3
4 changed files with 57 additions and 28 deletions

View File

@@ -97,7 +97,7 @@ class PostVersionTest < ActiveSupport::TestCase
end
should "not create a version if updating the post fails" do
@post.stubs(:set_tag_counts).raises(NotImplementedError)
@post.stubs(:update_tag_category_counts).raises(NotImplementedError)
assert_equal(2, @post.versions.size)
assert_raise(NotImplementedError) { @post.update(rating: "s") }