mirror of
https://github.com/kikobar/mastodon.git
synced 2024-12-23 22:34:13 +00:00
Fix number of results returned from TrendingTags.get
This commit is contained in:
parent
8241f162df
commit
69c34f3438
|
@ -17,7 +17,7 @@ class TrendingTags
|
|||
|
||||
def get(limit)
|
||||
key = "#{KEY}:#{Time.now.utc.beginning_of_day.to_i}"
|
||||
tag_ids = redis.zrevrange(key, 0, limit).map(&:to_i)
|
||||
tag_ids = redis.zrevrange(key, 0, limit - 1).map(&:to_i)
|
||||
tags = Tag.where(id: tag_ids).to_a.map { |tag| [tag.id, tag] }.to_h
|
||||
tag_ids.map { |tag_id| tags[tag_id] }.compact
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue