Commit 22a3c9e19244908d983ba7eb751c7b543e590bae

Authored by Andrew Kane
1 parent 7cf0fbfc

Fixed error with debug option

CHANGELOG.md
1 1 ## 4.5.3 (unreleased)
2 2  
3 3 - Added support for `OPENSEARCH_URL`
  4 +- Fixed error with `debug` option
4 5  
5 6 ## 4.5.2 (2021-08-05)
6 7  
... ...
lib/searchkick/query.rb
... ... @@ -110,7 +110,7 @@ module Searchkick
110 110  
111 111 # no easy way to tell which host the client will use
112 112 host =
113   - if Elasticsearch::VERSION.to_f >= 7.14
  113 + if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("7.14.0")
114 114 Searchkick.client.transport.transport.hosts.first
115 115 else
116 116 Searchkick.client.transport.hosts.first
... ...
test/test_helper.rb
... ... @@ -12,7 +12,7 @@ ENV["ES_PATH"] ||= "#{ENV["HOME"]}/elasticsearch/#{ENV["ELASTICSEARCH_VERSION"]}
12 12  
13 13 $logger = ActiveSupport::Logger.new(ENV["VERBOSE"] ? STDOUT : nil)
14 14  
15   -if Elasticsearch::VERSION.to_f >= 7.14
  15 +if Gem::Version.new(Elasticsearch::VERSION) >= Gem::Version.new("7.14.0")
16 16 Searchkick.client.transport.transport.logger = $logger
17 17 else
18 18 Searchkick.client.transport.logger = $logger
... ...