explore/posts/viewed: refactor post previews.
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
module PostSets
|
||||
class MostViewed < PostSets::Base
|
||||
attr_reader :date
|
||||
|
||||
def initialize(date)
|
||||
@date = date.blank? ? Date.today : Date.parse(date)
|
||||
end
|
||||
|
||||
def posts
|
||||
@posts ||= PostViewCountService.new.popular_posts(date)
|
||||
end
|
||||
|
||||
def presenter
|
||||
::PostSetPresenters::MostViewed.new(self)
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -5,7 +5,7 @@ class PostViewCountService
|
||||
|
||||
def initialize
|
||||
if !PostViewCountService.enabled?
|
||||
raise NotImplementedError.new("the Reportbooru service isn't configured. Missed searches are not available.")
|
||||
raise NotImplementedError.new("the Reportbooru service isn't configured. Post views are not available.")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user