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