elasticsearch-model-extensions 0.3.2 → 0.3.3

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
  SHA1:
3
- metadata.gz: 076cb7342044b51ad4a7920aae0dfc09070c015e
4
- data.tar.gz: bfc79e42c19c27aad6852d0df43513c4517678a5
3
+ metadata.gz: f0f78172ce35c1b446d6893e48dfb62a8483c2f0
4
+ data.tar.gz: 4ccd0c9871b9065fdee06cdd4f32c82b9e6d0825
5
5
  SHA512:
6
- metadata.gz: 553c045a7765157dadc41acf13e3cd14194efe87369088cbda79390dab9e48aa4f8655105af1dd0ccd06875fa5691d2def56c68438cffbefd7aaad5cac0bea81
7
- data.tar.gz: 7879a6be1cf2bf6f9292df21f8aa267d052d70354b8c1b19098ac32e9482c25742b0d3d47a7d63c06f405a295f8258d4051dce46e19b811fdbd11515ed13d217
6
+ metadata.gz: b39a2c10cb9fa7f87818d018912354423fe72bb071080f820b63898a27ce0368cbf9308e35356dff3a0699169158d8ef0fd32181f18a90353f72445b80913ef5
7
+ data.tar.gz: ce75230625c47a6122d25ebf2b0d47c83c3e67a5fb7dd354a1ab646ecaee80bc922ae3dfd2404929e20b3808fbcd5678fa54df81395212f0236d804e07521b97
@@ -33,7 +33,12 @@ module Elasticsearch
33
33
  begin
34
34
  find_record_or_raise
35
35
  rescue ActiveRecord::RecordNotFound => e
36
- Rails.logger.info "#{self.class.name}: #{e.to_s}"
36
+ message = "#{self.class.name}: #{e.to_s}"
37
+ if defined? ::Rails.logger.info
38
+ ::Rails.logger.info message
39
+ else
40
+ warn message
41
+ end
37
42
  nil
38
43
  end
39
44
  end
@@ -1,7 +1,7 @@
1
1
  module Elasticsearch
2
2
  module Model
3
3
  module Extensions
4
- VERSION = "0.3.2"
4
+ VERSION = "0.3.3"
5
5
  end
6
6
  end
7
7
  end
@@ -99,9 +99,13 @@ RSpec.describe Elasticsearch::Model::Extensions::BatchUpdating do
99
99
 
100
100
  describe '.update_index_in_parallel' do
101
101
  subject {
102
- Article.update_index_in_parallel(parallelism: 2)
102
+ Article.update_index_in_parallel(parallelism: 1)
103
103
  }
104
104
 
105
+ before(:each) do
106
+ expect(Parallel).to receive(:each).with([0..3], in_processes: 1).and_yield(1..3).once
107
+ end
108
+
105
109
  it_behaves_like 'indexing all articles'
106
110
  end
107
111
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-model-extensions
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yusuke KUOKA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-26 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler