diff options
author | multiple creatures <dev@multiple-creature.party> | 2019-12-03 15:23:57 -0600 |
---|---|---|
committer | multiple creatures <dev@multiple-creature.party> | 2019-12-03 15:23:57 -0600 |
commit | 5475adfbc94fad779a421168da1030e38bb138a4 (patch) | |
tree | d221b6e747d1d70f428aa48aa46f1491bc6ee4c4 /app/models | |
parent | 3f11f0955c3006997708e5566e5c9001eba837d6 (diff) |
add `size` property to feed model
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/feed.rb | 4 |
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) |