search_flip 2.0.0 → 2.1.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/search_flip/criteria.rb +3 -3
- data/lib/search_flip/version.rb +1 -1
- data/spec/search_flip/criteria_spec.rb +8 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 906fc0c71acae9c0ad7dd8b3089c78cbe73388348e43cd25470eb7289502652a
|
4
|
+
data.tar.gz: 5c45894fd491152c08cd3c5e39ca5bafa94e321ae81166dc7d3ce0012fa834ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2abdc760a6a104b242bd1147d4bf5629996c6e58b89b4a364b2b21c75daae0a3b57165577e75450b80fa965611b54a4680dd10deba7a22d3021381c7d893fa37
|
7
|
+
data.tar.gz: 81e2c3887da0f55653a60cbea327a068964b42acd30427b274f05e2091a5f30c67a7af0bbdac1ab38a29a31c97c4048a23c0ea265c5bb44c2b8a4ef7db8577d5
|
data/lib/search_flip/criteria.rb
CHANGED
@@ -407,15 +407,15 @@ module SearchFlip
|
|
407
407
|
# CommentIndex.range(lt: Time.parse("2014-01-01")).delete
|
408
408
|
# CommentIndex.where(public: false).delete
|
409
409
|
|
410
|
-
def delete
|
410
|
+
def delete(params = {})
|
411
411
|
dupped_request = request.dup
|
412
412
|
dupped_request.delete(:from)
|
413
413
|
dupped_request.delete(:size)
|
414
414
|
|
415
415
|
if connection.version.to_i >= 5
|
416
|
-
connection.http_client.post("#{target.type_url}/_delete_by_query", params: request_params, json: dupped_request)
|
416
|
+
connection.http_client.post("#{target.type_url}/_delete_by_query", params: request_params.merge(params), json: dupped_request)
|
417
417
|
else
|
418
|
-
connection.http_client.delete("#{target.type_url}/_query", params: request_params, json: dupped_request)
|
418
|
+
connection.http_client.delete("#{target.type_url}/_query", params: request_params.merge(params), json: dupped_request)
|
419
419
|
end
|
420
420
|
|
421
421
|
target.refresh if SearchFlip::Config[:auto_refresh]
|
data/lib/search_flip/version.rb
CHANGED
@@ -662,6 +662,14 @@ RSpec.describe SearchFlip::Criteria do
|
|
662
662
|
|
663
663
|
expect { ProductIndex.where(id: [product1.id, product2.id]).delete }.to change { ProductIndex.total_count }.by(-2)
|
664
664
|
end
|
665
|
+
|
666
|
+
it "accepts additional params" do
|
667
|
+
product = create(:product)
|
668
|
+
|
669
|
+
ProductIndex.import(product)
|
670
|
+
|
671
|
+
expect { ProductIndex.where(id: product.id).delete(conflicts: "proceed") }.to change { ProductIndex.total_count }.by(-1)
|
672
|
+
end
|
665
673
|
end
|
666
674
|
|
667
675
|
describe "#source" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: search_flip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.1.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benjamin Vetter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -229,9 +229,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
229
229
|
version: '0'
|
230
230
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
231
231
|
requirements:
|
232
|
-
- - "
|
232
|
+
- - ">"
|
233
233
|
- !ruby/object:Gem::Version
|
234
|
-
version:
|
234
|
+
version: 1.3.1
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
237
|
rubygems_version: 2.7.3
|