elasticsearch-model 7.1.1 → 7.1.2.pre

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4301031eeda01ef94c74b9ad4dc6943a248f876408332d79d1215efddab9eef1
4
- data.tar.gz: 7b180c808882ae6539ecc42abe550138fd55b79a1548230529dbd0ddc6af30a4
3
+ metadata.gz: 51e1e98703f1834d64dc969afcc75f107460220a9e213dc128dc5e1015be5a7b
4
+ data.tar.gz: b44da631182388ef384dcab9f6e9d3626c40bf2b6272ef35c6f4857670320f6e
5
5
  SHA512:
6
- metadata.gz: c16dc60e532cbbca544cd234e8897168de3504ced1c9d13a2b7e531a8aaa8e03acf48934f6605dcfb4a35f2e4a32f74a211382302a911411a113d22294b0756a
7
- data.tar.gz: 28606153ac91b2bfbd472c8727d7764964a793cb4075d9d3b30eb39bb72dda8192020c6e00e2b39e044c36883a1a18cf34c0e5454b939780d3bd9969fe693b53
6
+ metadata.gz: a627d5e725a0a3ffb0476873617e0f5d99f297ac1bad49554b69e1546f28bbc58a6cd3b3e54282d0127ed3da828f187f6dba4dc449bbe51ad8229b0b0167a276
7
+ data.tar.gz: 35b7bc2cb6161fff40247e4cf76fd789ffbc12c4c2acfb1e8223b567ce799bcb12a9fd8857cf1bdbdb13999a981114b2e46f6054f5a27dfb1d487cb188f86860
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
42
42
  s.required_ruby_version = '>= 2.4'
43
43
 
44
44
  s.add_dependency 'activesupport', '> 3'
45
- s.add_dependency 'elasticsearch', '> 1'
45
+ s.add_dependency 'elasticsearch', '~> 7'
46
46
  s.add_dependency 'hashie'
47
47
 
48
48
  s.add_development_dependency 'activemodel', '> 3'
@@ -270,7 +270,7 @@ module Elasticsearch
270
270
  def index_exists?(options={})
271
271
  target_index = options[:index] || self.index_name
272
272
 
273
- self.client.indices.exists(index: target_index) rescue false
273
+ self.client.indices.exists(index: target_index, ignore: 404)
274
274
  end
275
275
 
276
276
  # Deletes the index with corresponding name
@@ -85,7 +85,7 @@ module Elasticsearch
85
85
  # @return [Array] the list of document types used for retrieving documents
86
86
  #
87
87
  def document_type
88
- models.map { |m| m.document_type }
88
+ models.map { |m| m.document_type }.compact.presence
89
89
  end
90
90
 
91
91
  # Get the client common for all models
@@ -17,6 +17,6 @@
17
17
 
18
18
  module Elasticsearch
19
19
  module Model
20
- VERSION = "7.1.1"
20
+ VERSION = "7.1.2.pre"
21
21
  end
22
22
  end
@@ -659,36 +659,6 @@ describe Elasticsearch::Model::Indexing do
659
659
  expect(DummyIndexingModel.index_exists?).to be(false)
660
660
  end
661
661
  end
662
-
663
- context 'when the index API raises an error' do
664
-
665
- let(:client) do
666
- double('client').tap do |cl|
667
- expect(cl).to receive(:indices).and_raise(StandardError)
668
- end
669
- end
670
-
671
- it 'returns false' do
672
- expect(DummyIndexingModel.index_exists?).to be(false)
673
- end
674
- end
675
-
676
- context 'when the indices.exists API raises an error' do
677
-
678
- let(:client) do
679
- double('client', indices: indices)
680
- end
681
-
682
- let(:indices) do
683
- double('indices').tap do |ind|
684
- expect(ind).to receive(:exists).and_raise(StandardError)
685
- end
686
- end
687
-
688
- it 'returns false' do
689
- expect(DummyIndexingModel.index_exists?).to be(false)
690
- end
691
- end
692
662
  end
693
663
 
694
664
  describe '#delete_index!' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 7.1.1
4
+ version: 7.1.2.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-19 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: elasticsearch
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">"
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1'
33
+ version: '7'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">"
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1'
40
+ version: '7'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -452,11 +452,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
452
452
  version: '2.4'
453
453
  required_rubygems_version: !ruby/object:Gem::Requirement
454
454
  requirements:
455
- - - ">="
455
+ - - ">"
456
456
  - !ruby/object:Gem::Version
457
- version: '0'
457
+ version: 1.3.1
458
458
  requirements: []
459
- rubygems_version: 3.1.2
459
+ rubygems_version: 3.1.4
460
460
  signing_key:
461
461
  specification_version: 4
462
462
  summary: ActiveModel/Record integrations for Elasticsearch.