Skip to content

Commit

Permalink
Add support for the headline ingredient
Browse files Browse the repository at this point in the history
Add headline to the list of supported ingredients. It contains valuable information and should be in the search index.
  • Loading branch information
sascha-karnatz committed Oct 9, 2024
1 parent 48d79bc commit 9962864
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/alchemy-pg_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Alchemy
@@search_class = PgSearch

module PgSearch
SEARCHABLE_INGREDIENTS = %w[Text Richtext Picture]
SEARCHABLE_INGREDIENTS = %w[Text Richtext Headline Picture]

extend Config

Expand Down
7 changes: 7 additions & 0 deletions spec/models/ingredient_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@
it_behaves_like "a searchable content"
end

describe Alchemy::Ingredients::Headline do
let(:ingredient) { create(:alchemy_ingredient_headline, value: "foo bar", element: element) }

it_behaves_like "it is searchable"
it_behaves_like "a searchable content"
end

describe Alchemy::Ingredients::Picture do
let(:ingredient) { create(:alchemy_ingredient_picture, value: create(:alchemy_picture), caption: content, element: element) }

Expand Down

0 comments on commit 9962864

Please sign in to comment.