Add experimental machine learning

This commit is contained in:
Machine Learning
2021-06-18 12:27:29 +07:00
committed by Javi Martín
parent c8d8fae98d
commit 4d27bbebad
84 changed files with 2845 additions and 30 deletions

View File

@@ -0,0 +1,17 @@
class MachineLearning::CommentsSummaryComponent < ApplicationComponent
attr_reader :commentable
def initialize(commentable)
@commentable = commentable
end
def render?
MachineLearning.enabled? && Setting["machine_learning.comments_summary"].present? && body.present?
end
private
def body
commentable.summary_comment&.body
end
end