fixes #3359
This commit is contained in:
@@ -3,7 +3,7 @@ module PostSets
|
||||
attr_reader :date
|
||||
|
||||
def initialize(date)
|
||||
@date = (date.blank? ? Time.zone.now : Time.zone.parse(date)).to_date
|
||||
@date = date.blank? ? Date.today : Date.parse(date)
|
||||
end
|
||||
|
||||
def posts
|
||||
|
||||
@@ -32,7 +32,7 @@ class PostViewCountService
|
||||
end
|
||||
|
||||
def popular_posts(date = Date.today)
|
||||
ranking = fetch_rank(date)
|
||||
ranking = fetch_rank(date) || []
|
||||
ranking.map {|x| Post.find(x[0])}
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user