mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
PERF: Dematerialize topic_reply_count (#9769)
* PERF: Dematerialize topic_reply_count It's only ever used for trust level promotions that run daily, or compared to 0. We don't need to track it on every post creation. * UX: Add symbol in TL3 report if topic reply count is capped * DEV: Drop user_stats.topic_reply_count column
This commit is contained in:
@@ -111,14 +111,12 @@ describe PostOwnerChanger do
|
||||
topic_count: 1,
|
||||
post_count: 1,
|
||||
first_post_created_at: p1.created_at,
|
||||
topic_reply_count: 0
|
||||
)
|
||||
|
||||
p2user.user_stat.update!(
|
||||
topic_count: 0,
|
||||
post_count: 1,
|
||||
first_post_created_at: p2.created_at,
|
||||
topic_reply_count: 1
|
||||
)
|
||||
|
||||
UserAction.create!(action_type: UserAction::NEW_TOPIC, user_id: p1user.id, acting_user_id: p1user.id,
|
||||
@@ -155,13 +153,11 @@ describe PostOwnerChanger do
|
||||
p1_user_stat = p1user.user_stat
|
||||
|
||||
expect(p1_user_stat.first_post_created_at).to eq(nil)
|
||||
expect(p1_user_stat.topic_reply_count).to eq(0)
|
||||
expect(p1_user_stat.likes_received).to eq(0)
|
||||
|
||||
p2_user_stat = p2user.user_stat
|
||||
|
||||
expect(p2_user_stat.first_post_created_at).to eq(nil)
|
||||
expect(p2_user_stat.topic_reply_count).to eq(0)
|
||||
|
||||
user_a_stat = user_a.user_stat
|
||||
|
||||
|
||||
Reference in New Issue
Block a user