popular searches: fix blank search counts on /explore/posts/searches.

This commit is contained in:
evazion
2020-06-27 02:09:09 -05:00
parent ff096b8adc
commit dd857c6695
2 changed files with 2 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ module Explore
def searches
@date, @scale, @min_date, @max_date = parse_date(params)
@searches = ReportbooruService.new.popular_searches(@date)
@searches = ReportbooruService.new.post_search_rankings(@date)
end
def missed_searches

View File

@@ -30,6 +30,7 @@ class ReportbooruService
def popular_searches(date, limit: 100)
ranking = post_search_rankings(date)
ranking = post_search_rankings(date.yesterday) if ranking.blank?
ranking.take(limit).map(&:first)
end