discourse/app
Alan Guo Xiang Tan 5bd55acf83
FIX: Add DB constraints for post & topic counter cache for UserStat (#15626)
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`.
2022-02-07 11:23:34 +08:00
..
assets FIX: allow native lazy loading attribute for quoted avatar image (#15834) 2022-02-07 09:28:26 +08:00
controllers FIX: Better param guards for wiki and post_type posts controller. 2022-02-07 09:21:24 +08:00
helpers PERF: Update ember-auto-import (#15814) 2022-02-04 11:00:51 +00:00
jobs DEV: Update :critical_user_email calls to use strings (#15827) 2022-02-04 23:43:53 +00:00
mailers DEV: Hash tokens stored from email_tokens (#14493) 2021-11-25 09:34:39 +02:00
models FIX: Add DB constraints for post & topic counter cache for UserStat (#15626) 2022-02-07 11:23:34 +08:00
serializers DEV: Add markdown_additional_options to Site (#15738) 2022-01-28 13:02:02 +10:00
services FIX: Add DB constraints for post & topic counter cache for UserStat (#15626) 2022-02-07 11:23:34 +08:00
views PERF: Update ember-auto-import (#15814) 2022-02-04 11:00:51 +00:00