Files
grecia/app/components/machine_learning/comments_summary_component.rb
2021-08-16 16:31:04 +02:00

18 lines
367 B
Ruby

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