Files
fizzy/app/models/card/searchable.rb
T
Jorge Manrubia aa1ffb3357 Remove AI summaries and semantic searches
We were not using either. We can restore if we revisit.
2025-10-29 11:55:32 +01:00

23 lines
589 B
Ruby

module Card::Searchable
extend ActiveSupport::Concern
included do
include ::Searchable
searchable_by :title, :description, using: :cards_search_index
scope :mentioning, ->(query) do
cards = Card.search(query).select(:id).to_sql
comments = Comment.search(query).select(:id).to_sql
left_joins(:comments).where("cards.id in (#{cards}) or comments.id in (#{comments})").distinct
end
end
private
# TODO: Temporary until we stabilize the search API
def title_and_description
[ title, description.to_plain_text ].join(" ")
end
end