From 5475adfbc94fad779a421168da1030e38bb138a4 Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Tue, 3 Dec 2019 15:23:57 -0600 Subject: add `size` property to feed model --- app/models/feed.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'app/models') 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) -- cgit