mirror of
https://github.com/discourse/discourse-ai.git
synced 2025-03-03 15:59:59 +00:00
* 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.
17 lines
381 B
Ruby
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
|