reportbooru: raise exception if not configured.

This commit is contained in:
evazion
2017-04-05 01:03:20 -05:00
parent 08867fa84d
commit f57561118c
4 changed files with 20 additions and 2 deletions

View File

@@ -2,7 +2,15 @@
class PopularSearchService
attr_reader :date, :scale
def self.enabled?
Danbooru.config.reportbooru_server.present?
end
def initialize(date, scale)
if !PopularSearchService.enabled?
raise NotImplementedError.new("the Reportbooru service isn't configured. Popular searches are not available.")
end
@date = date
@scale = scale
end