You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
403 B

  1. # frozen_string_literal: true
  2. module Trends
  3. def self.table_name_prefix
  4. 'trends_'
  5. end
  6. def self.links
  7. @links ||= Trends::Links.new
  8. end
  9. def self.tags
  10. @tags ||= Trends::Tags.new
  11. end
  12. def self.refresh!
  13. [links, tags].each(&:refresh)
  14. end
  15. def self.request_review!
  16. [links, tags].each(&:request_review) if enabled?
  17. end
  18. def self.enabled?
  19. Setting.trends
  20. end
  21. end