add most viewed posts page

This commit is contained in:
r888888888
2017-11-10 16:21:01 -08:00
parent 6c4eb62957
commit 8b1fca4662
8 changed files with 109 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
module PostSets
class MostViewed < PostSets::Base
attr_reader :date
def initialize(date)
@date = date.blank? ? Time.zone.now : Time.zone.parse(date)
end
def posts
@posts ||= PostViewCountService.new.popular_posts(date)
end
def presenter
::PostSetPresenters::MostViewed.new(self)
end
end
end