mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 07:43:43 +08:00
5bd55acf83
Ensures that `UserStat#post_count` and `UserStat#topic_count` does not go below 0. When it does like it did now, we tend to have bugs in our code since we're usually coding with the assumption that the count isn't negative. In order to support the constraints, our post and topic fabricators in tests will now automatically increment the count for the respective user's `UserStat` as well. We have to do this because our fabricators bypasss `PostCreator` which holds the responsibility of updating `UserStat#post_count` and `UserStat#topic_count`. |
||
---|---|---|
.. | ||
bookmark_guardian.rb | ||
category_guardian.rb | ||
ensure_magic.rb | ||
group_guardian.rb | ||
post_guardian.rb | ||
post_revision_guardian.rb | ||
tag_guardian.rb | ||
topic_guardian.rb | ||
user_guardian.rb |