Skip to content

Commit

Permalink
Fix deprecated string access in config_for hashes
Browse files Browse the repository at this point in the history
  • Loading branch information
pudiva committed Aug 4, 2020
1 parent 8bbfbd9 commit a884077
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions config/initializers/elasticsearch.rb
@@ -1,10 +1,10 @@
es_config = Rails.configuration.elasticsearch

host = es_config["host"]
host = es_config[:host]

if host.blank?
vcap = JSON.parse(es_config["vcap_services"])
host = vcap.dig("elasticsearch", 0, "credentials", "uri")
vcap = JSON.parse(es_config[:vcap_services])
host = vcap.dig(:elasticsearch, 0, :credentials, :uri)
end

raise StandardError.new("No elasticsearch environment variables found") if host.blank?
Expand All @@ -13,10 +13,10 @@
host: host,
transport_options: {
request: {
timeout: es_config.fetch("elastic_timeout"),
timeout: es_config.fetch(:elastic_timeout),
},
ssl: {
verify: es_config.fetch("verify_ssl", true),
verify: es_config.fetch(:verify_ssl, true),
},
},
)

0 comments on commit a884077

Please sign in to comment.