0
0
Fork 0

Add Reviewable model concern (#31152)

This commit is contained in:
Matt Jankowski 2024-09-03 11:37:45 -04:00 committed by GitHub
parent 2f0d0fc127
commit 7c26e5e4a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 85 additions and 48 deletions

View file

@ -21,6 +21,8 @@
class Tag < ApplicationRecord
include Paginable
include Reviewable
# rubocop:disable Rails/HasAndBelongsToMany
has_and_belongs_to_many :statuses
has_and_belongs_to_many :accounts
@ -97,22 +99,6 @@ class Tag < ApplicationRecord
alias trendable? trendable
def requires_review?
reviewed_at.nil?
end
def reviewed?
reviewed_at.present?
end
def requested_review?
requested_review_at.present?
end
def requires_review_notification?
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