Add experimental machine learning
This commit is contained in:
committed by
Javi Martín
parent
c8d8fae98d
commit
4d27bbebad
@@ -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
|
||||
Reference in New Issue
Block a user