diff --git a/app/controller/alchemy/pg_search/controller_methods.rb b/app/controller/alchemy/pg_search/controller_methods.rb index fc59ec0..e9a2540 100644 --- a/app/controller/alchemy/pg_search/controller_methods.rb +++ b/app/controller/alchemy/pg_search/controller_methods.rb @@ -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. diff --git a/lib/alchemy-pg_search.rb b/lib/alchemy-pg_search.rb index c7424bc..2e79354 100644 --- a/lib/alchemy-pg_search.rb +++ b/lib/alchemy-pg_search.rb @@ -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]