about summary refs log tree commit diff
path: root/app/models
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-03-12 16:09:46 +0100
committerEugen Rochko <eugen@zeonfederated.com>2016-03-12 16:21:53 +0100
commitaab9f57e369c492bad03bcf15411394897314b4d (patch)
treeae8cf704e2b2321993cabf326af82ae0f86b6697 /app/models
parent447cfef62d74a670ddd600c0240f41746ac2fe0a (diff)
Adding config for puma, dashboard layout, fixing some queries
Diffstat (limited to 'app/models')
-rw-r--r--app/models/status.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/app/models/status.rb b/app/models/status.rb
index 4fedad107..52e6f8a21 100644
--- a/app/models/status.rb
+++ b/app/models/status.rb
@@ -49,6 +49,14 @@ class Status < ActiveRecord::Base
     content.truncate(80, omission: "...")
   end
 
+  def reblogs_count
+    self.attributes['reblogs_count'] || self.reblogs.count
+  end
+
+  def favourites_count
+    self.attributes['favourites_count'] || self.favourites.count
+  end
+
   def mentions
     m = []