about summary refs log tree commit diff
path: root/app/models/trends/base.rb
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2021-11-26 01:15:29 +0100
committerClaire <claire.github-309c@sitedethib.com>2021-11-26 01:15:29 +0100
commitafd71867bad4cc826656bd8931b25c8ea8317fff (patch)
treecaef1b579ad8ebdb48dc2ee8633ba9a1a7cdc587 /app/models/trends/base.rb
parentb4f785c1f46693c4e42b035e6728f99aac1b85db (diff)
Revert "Fix trends admin page crashing"
This reverts commit 5f10e64330635bfd609ba5acdd78fa505c12f5b1.
Diffstat (limited to 'app/models/trends/base.rb')
-rw-r--r--app/models/trends/base.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/models/trends/base.rb b/app/models/trends/base.rb
index 788f128a0..b767dcb1a 100644
--- a/app/models/trends/base.rb
+++ b/app/models/trends/base.rb
@@ -3,6 +3,19 @@
 class Trends::Base
   include Redisable
 
+  class_attribute :default_options
+
+  attr_reader :options
+
+  # @param [Hash] options
+  # @option options [Integer] :threshold Minimum amount of uses by unique accounts to begin calculating the score
+  # @option options [Integer] :review_threshold Minimum rank (lower = better) before requesting a review
+  # @option options [ActiveSupport::Duration] :max_score_cooldown For this amount of time, the peak score (if bigger than current score) is decayed-from
+  # @option options [ActiveSupport::Duration] :max_score_halflife How quickly a peak score decays
+  def initialize(options = {})
+    @options = self.class.default_options.merge(options)
+  end
+
   def register(_status)
     raise NotImplementedError
   end