Class: ContentEmbedding::ActivityEmbedding

Inherits:
ContentEmbedding
  • Object
show all
Includes:
TextSearchable
Defined in:
app/models/content_embedding/activity_embedding.rb

Constant Summary

Constants included from TextSearchable

TextSearchable::EMBEDDING_MODEL, TextSearchable::SIMILARITY_THRESHOLD

Belongs to collapse

Class Method Summary collapse

Methods included from TextSearchable

apply_locale_filter, apply_published_filter, generate_text_query_embedding, locale_filtered?, semantic_search

Class Method Details

.primary_contentActiveRecord::Relation<ContentEmbedding::ActivityEmbedding>

A relation of ContentEmbedding::ActivityEmbeddings that are primary content. Active Record Scope

Returns:

See Also:



52
# File 'app/models/content_embedding/activity_embedding.rb', line 52

scope :primary_content, -> { where(content_type: 'primary') }

.with_embeddingActiveRecord::Relation<ContentEmbedding::ActivityEmbedding>

A relation of ContentEmbedding::ActivityEmbeddings that are with embedding. Active Record Scope

Returns:

See Also:



53
# File 'app/models/content_embedding/activity_embedding.rb', line 53

scope :with_embedding, -> { where.not(embedding: nil) }

Instance Method Details

#embeddableActivity Also known as: activity

Returns:

See Also:



47
# File 'app/models/content_embedding/activity_embedding.rb', line 47

belongs_to :embeddable, class_name: 'Activity'