Skip to content

Commit

Permalink
fix broken check for env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
simonoff committed Nov 20, 2023
1 parent a04c3f5 commit 1c15286
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/graphql/mutations/predicates/search_predicate.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/graphql/types/app_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 1 addition & 1 deletion app/models/app_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions config/initializers/searchkick.rb
Original file line number Diff line number Diff line change
@@ -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
end

0 comments on commit 1c15286

Please sign in to comment.