about summary refs log tree commit diff
path: root/app/models/status_stat.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/status_stat.rb')
-rw-r--r--app/models/status_stat.rb12
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