discourse-ai/lib/post_extensions.rb
Roman Rizzi ce6a2eca21
FEATURE: Backfill posts sentiment. (#982)
* FEATURE: Backfill posts sentiment.

It adds a scheduled job to backfill posts' sentiment, similar to our existing rake task, but with two settings to control the batch size and posts' max-age.

* Make sure model_name order is consistent.
2024-12-03 10:27:03 -03:00

17 lines
381 B
Ruby

# frozen_string_literal: true
module DiscourseAi
module PostExtensions
extend ActiveSupport::Concern
prepended do
has_many :classification_results, as: :target
has_many :sentiment_classifications,
-> { where(classification_type: "sentiment") },
class_name: "ClassificationResult",
as: :target
end
end
end