about summary refs log tree commit diff
path: root/app/models/tag.rb
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2021-11-26 01:12:39 +0100
committerGitHub <noreply@github.com>2021-11-26 01:12:39 +0100
commit12b3ff6c6d70df1ce34f4b103b519250c9e2d2c8 (patch)
treef64f6d487b6cb17342e9096296deb69d3adf4e98 /app/models/tag.rb
parentb1fd6d44901a13450d22884b02eb6e9ae4fc1248 (diff)
Fix error on trending hashtags/links pages in admin UI due to missing constant (#17044)
Diffstat (limited to 'app/models/tag.rb')
-rw-r--r--app/models/tag.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/tag.rb b/app/models/tag.rb
index f35d92b5d..a64042614 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -80,6 +80,10 @@ class Tag < ApplicationRecord
     requires_review? && !requested_review?
   end
 
+  def decaying?
+    max_score_at && max_score_at >= Trends.tags.options[:max_score_cooldown].ago && max_score_at < 1.day.ago
+  end
+
   def history
     @history ||= Trends::History.new('tags', id)
   end