searchkick 4.5.1 → 4.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 44f4a5255a208b7d24aa1b6d668808d3aff83a9ebb9f07a1a1a83fd9e3845738
4
- data.tar.gz: 0ac096c02151a04a00751de140520547570b9c24fa2fccffd9d4761637b85531
3
+ metadata.gz: 81a9204c559530b42163004d28daaafce96c3368ae9949a0214b3d8701003a54
4
+ data.tar.gz: ba8b73a669a257eedc8f2533d7dfbbde960ad0b5b5a5cfec2d6923a127eb6df1
5
5
  SHA512:
6
- metadata.gz: ff25ecdd74852fdbca33909d37445adbb42aa76785df75d9f1d9903d1dbee5712507d30a654dfaf829b9b6c0db0148cf48fbb4a257e3decf69e6c316c40b66fc
7
- data.tar.gz: e07d8ddd9dbcf661db01948a7f20ad0b91d6427adddbbe987d571011983046650bd21726f74a2d0d11caaf9d49cd83b70a92738dc1cb21346e2c74009a1c494c
6
+ metadata.gz: 1d5a878593afa54f7db54163b6e3166ecd76fe784ef28a5d0e22ae874dd1fc4ffc6743d38f27015b2b30c1f5a79c280ef326e0fd240fb51459677bd2a3f20abb
7
+ data.tar.gz: 956e52c052b0ce74ada39e30425c3191878a4cc4e08c91dd8eefc37bba9a47a924481c344329efd203ca133b1ec26e1cce2673dd60603e8aec44233fae24b51e
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 4.5.2 (2021-08-05)
2
+
3
+ - Fixed error with reindex queue
4
+ - Fixed error with `model_name` method with multiple models
5
+ - Fixed error with `debug` option with elasticsearch-ruby 7.14
6
+
1
7
  ## 4.5.1 (2021-08-03)
2
8
 
3
9
  - Improved performance of reindex queue
@@ -109,7 +109,12 @@ module Searchkick
109
109
  request_params = query.except(:index, :type, :body)
110
110
 
111
111
  # no easy way to tell which host the client will use
112
- host = Searchkick.client.transport.hosts.first
112
+ host =
113
+ if Elasticsearch::VERSION.to_f >= 7.14
114
+ Searchkick.client.transport.transport.hosts.first
115
+ else
116
+ Searchkick.client.transport.hosts.first
117
+ end
113
118
  credentials = host[:user] || host[:password] ? "#{host[:user]}:#{host[:password]}@" : nil
114
119
  params = ["pretty"]
115
120
  request_params.each do |k, v|
@@ -15,7 +15,7 @@ module Searchkick
15
15
  # TODO use reliable queuing
16
16
  def reserve(limit: 1000)
17
17
  if supports_rpop_with_count?
18
- Searchkick.with_redis { |r| r.call("rpop", redis_key, limit) }
18
+ Searchkick.with_redis { |r| r.call("rpop", redis_key, limit) }.to_a
19
19
  else
20
20
  record_ids = []
21
21
  Searchkick.with_redis do |r|
@@ -71,7 +71,11 @@ module Searchkick
71
71
  end
72
72
 
73
73
  def model_name
74
- klass.model_name
74
+ if klass.nil?
75
+ ActiveModel::Name.new(self.class, nil, 'Result')
76
+ else
77
+ klass.model_name
78
+ end
75
79
  end
76
80
 
77
81
  def entry_name(options = {})
@@ -1,3 +1,3 @@
1
1
  module Searchkick
2
- VERSION = "4.5.1"
2
+ VERSION = "4.5.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.5.1
4
+ version: 4.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-03 00:00:00.000000000 Z
11
+ date: 2021-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel