diff --git a/app/graphql/mutations/predicates/search_predicate.rb b/app/graphql/mutations/predicates/search_predicate.rb index eb6e55552..a3d24b8f4 100644 --- a/app/graphql/mutations/predicates/search_predicate.rb +++ b/app/graphql/mutations/predicates/search_predicate.rb @@ -8,7 +8,7 @@ class Predicates::SearchPredicate < Mutations::BaseMutation end def app_users(app, per, page) - @app_users = if Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" && app.searchkick_enabled? + @app_users = if Chaskiq::Config.get("SEARCHKICK_ENABLED").present? && app.searchkick_enabled? @segment.es_search(page, per).includes(taggings: :tag) else @segment.execute_query diff --git a/app/graphql/types/app_type.rb b/app/graphql/types/app_type.rb index b12039520..321e5ddff 100644 --- a/app/graphql/types/app_type.rb +++ b/app/graphql/types/app_type.rb @@ -522,7 +522,7 @@ def article(id:, lang:) end def contact_search(term:) - if Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" && object.searchkick_enabled? + if Chaskiq::Config.get("SEARCHKICK_ENABLED").present? && object.searchkick_enabled? AppUser.search( term, fields: %i[name last_name first_name email phone], diff --git a/app/models/app_user.rb b/app/models/app_user.rb index 46023860b..f485bf06e 100644 --- a/app/models/app_user.rb +++ b/app/models/app_user.rb @@ -431,6 +431,6 @@ def self.properties_for_index end def should_index? - Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" && app.searchkick_enabled? + Chaskiq::Config.get("SEARCHKICK_ENABLED").present? && app.searchkick_enabled? end end diff --git a/config/initializers/searchkick.rb b/config/initializers/searchkick.rb index 3e10b8851..ce1055e8d 100644 --- a/config/initializers/searchkick.rb +++ b/config/initializers/searchkick.rb @@ -1,3 +1,3 @@ -if Chaskiq::Config.get("SEARCHKICK_ENABLED") == "true" +if Chaskiq::Config.get("SEARCHKICK_ENABLED").present? Searchkick.client_type = Chaskiq::Config.fetch("SEARCHKICK_CLIENT", "elasticsearch").to_sym -end \ No newline at end of file +end