diff options
author | Starfall <us@starfall.systems> | 2022-06-06 13:35:20 -0500 |
---|---|---|
committer | Starfall <us@starfall.systems> | 2022-06-06 13:35:20 -0500 |
commit | 78266a002b4735caaef07098ba66419fd71f47c1 (patch) | |
tree | 4ba2bc330d5ed4b6a3a926ab9a03a89f56bc8843 /app/models/status_stat.rb | |
parent | e9b2e11520056d0ec822ac0862923d00c6a1289c (diff) | |
parent | 434b08e95b1a440bf9ae563b72600d1590106260 (diff) |
Merge remote-tracking branch 'glitch/main'
Diffstat (limited to 'app/models/status_stat.rb')
-rw-r--r-- | app/models/status_stat.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/app/models/status_stat.rb b/app/models/status_stat.rb index 024c467e7..437861d1c 100644 --- a/app/models/status_stat.rb +++ b/app/models/status_stat.rb @@ -17,6 +17,18 @@ class StatusStat < ApplicationRecord after_commit :reset_parent_cache + def replies_count + [attributes['replies_count'], 0].max + end + + def reblogs_count + [attributes['reblogs_count'], 0].max + end + + def favourites_count + [attributes['favourites_count'], 0].max + end + private def reset_parent_cache |