about summary refs log tree commit diff
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-03 15:23:57 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-03 15:23:57 -0600
commit5475adfbc94fad779a421168da1030e38bb138a4 (patch)
treed221b6e747d1d70f428aa48aa46f1491bc6ee4c4
parent3f11f0955c3006997708e5566e5c9001eba837d6 (diff)
add `size` property to feed model
-rw-r--r--app/models/feed.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/feed.rb b/app/models/feed.rb
index 0e8943ff8..3e34be172 100644
--- a/app/models/feed.rb
+++ b/app/models/feed.rb
@@ -12,6 +12,10 @@ class Feed
     from_redis(limit, max_id, since_id, min_id)
   end
 
+  def size
+    redis.zcount(key, '-inf', '+inf') || 0
+  end
+
   protected
 
   def from_redis(limit, max_id, since_id, min_id)