Class: Decidim::Ai::SpamDetection::UserSpamAnalyzerJob
- Inherits:
-
GenericSpamAnalyzerJob
- Object
- Decidim::ApplicationJob
- ApplicationJob
- ApplicationJob
- GenericSpamAnalyzerJob
- Decidim::Ai::SpamDetection::UserSpamAnalyzerJob
- Defined in:
- app/jobs/decidim/ai/spam_detection/user_spam_analyzer_job.rb
Instance Method Summary collapse
Instance Method Details
#perform(reportable) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'app/jobs/decidim/ai/spam_detection/user_spam_analyzer_job.rb', line 7 def perform(reportable) @author = reportable @organization = reportable.organization classifier.classify(reportable.about) return unless classifier.score >= Decidim::Ai::SpamDetection.user_score_threshold Decidim::CreateUserReport.call(form, reportable) end |