diff options
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/preview_card.rb | 4 | ||||
-rw-r--r-- | app/models/tag.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/app/models/preview_card.rb b/app/models/preview_card.rb index f2ab8ecab..0f9e23fa1 100644 --- a/app/models/preview_card.rb +++ b/app/models/preview_card.rb @@ -84,6 +84,10 @@ class PreviewCard < ApplicationRecord attributes['trendable'].nil? && (provider.nil? || provider.requires_review_notification?) end + def decaying? + max_score_at && max_score_at >= Trends.links.options[:max_score_cooldown].ago && max_score_at < 1.day.ago + end + attr_writer :provider def local? 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 |