Skip to content

Commit

Permalink
Merge pull request #55 from sascha-karnatz/search_class
Browse files Browse the repository at this point in the history
Introduce a search_class configuration into Alchemy
  • Loading branch information
tvdeyen authored Oct 8, 2024
2 parents adfa755 + 0c43766 commit 7418988
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/controller/alchemy/pg_search/controller_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def perform_search
# @return [Array]
#
def search_results
Alchemy::PgSearch.search params[:query], ability: current_ability
Alchemy.search_class.search params[:query], ability: current_ability
end

# A view helper that loads the search result page.
Expand Down
3 changes: 3 additions & 0 deletions lib/alchemy-pg_search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
require "alchemy/pg_search/config"

module Alchemy
mattr_accessor :search_class
@@search_class = PgSearch

module PgSearch
SEARCHABLE_INGREDIENTS = %w[Text Richtext Picture]

Expand Down

0 comments on commit 7418988

Please sign in to comment.