kithe 2.2.0 → 2.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f1252c0becbda9f754e23af2333aaae66cf40cbfd6bacdad0f97425cd317de6
|
4
|
+
data.tar.gz: 8460f704869d27d5a2011f746e88b9016fde465d1cbb023c883fe600b0510c1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz: '
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0890b072c3bfb9901f4c910fcaf0f288dd72dc8c8164202998dfabf2db4b3f7a09dfeaa8df6c4c9cd242b0c98ec084c48f5214d4a2c8f4991ee6d08643495857'
|
7
|
+
data.tar.gz: e7c2bbe6f3f32ce67c646289f038a06d51f371fdb87634657296546c84fe3cb52a216b0a3c6648669f73e7d61f51b56a3afb0d28584fc85950dbf0936d6f5eda
|
@@ -57,7 +57,7 @@ module Kithe
|
|
57
57
|
def initialize(batching:, disable_callbacks:, original_settings:,
|
58
58
|
writer:, on_finish:)
|
59
59
|
@original_settings = original_settings
|
60
|
-
@batching =
|
60
|
+
@batching = batching
|
61
61
|
@disable_callbacks = disable_callbacks
|
62
62
|
@on_finish = on_finish
|
63
63
|
|
@@ -80,8 +80,9 @@ module Kithe
|
|
80
80
|
def writer
|
81
81
|
@writer ||= begin
|
82
82
|
if @batching
|
83
|
+
batch_size = (@batching == true) ? Kithe.indexable_settings.batching_mode_batch_size : @batching
|
83
84
|
@local_writer = true
|
84
|
-
Kithe.indexable_settings.writer_instance!("solr_writer.batch_size" =>
|
85
|
+
Kithe.indexable_settings.writer_instance!("solr_writer.batch_size" => batch_size)
|
85
86
|
end
|
86
87
|
end
|
87
88
|
end
|
@@ -1,5 +1,8 @@
|
|
1
1
|
class Kithe::Validators::ModelParent < ActiveModel::Validator
|
2
2
|
def validate(record)
|
3
|
+
# don't load the parent just to validate it if it hasn't even changed.
|
4
|
+
return unless record.parent_id_changed?
|
5
|
+
|
3
6
|
if record.parent.present? && (record.parent.class <= Kithe::Asset)
|
4
7
|
record.errors.add(:parent, 'can not be an Asset instance')
|
5
8
|
end
|
@@ -7,7 +10,5 @@ class Kithe::Validators::ModelParent < ActiveModel::Validator
|
|
7
10
|
if record.parent.present? && record.class <= Kithe::Collection
|
8
11
|
record.errors.add(:parent, 'is invalid for Collection instances')
|
9
12
|
end
|
10
|
-
|
11
|
-
# TODO avoid recursive parents, maybe using a postgres CTE for efficiency?
|
12
13
|
end
|
13
14
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
module Kithe
|
2
2
|
class IndexableSettings
|
3
3
|
attr_accessor :solr_url, :writer_class_name, :writer_settings,
|
4
|
-
:model_name_solr_field, :solr_id_value_attribute, :disable_callbacks
|
4
|
+
:model_name_solr_field, :solr_id_value_attribute, :disable_callbacks,
|
5
|
+
:batching_mode_batch_size
|
5
6
|
def initialize(solr_url:, writer_class_name:, writer_settings:,
|
6
|
-
model_name_solr_field:, solr_id_value_attribute:, disable_callbacks: false
|
7
|
+
model_name_solr_field:, solr_id_value_attribute:, disable_callbacks: false,
|
8
|
+
batching_mode_batch_size: 100)
|
7
9
|
@solr_url = solr_url
|
8
10
|
@writer_class_name = writer_class_name
|
9
11
|
@writer_settings = writer_settings
|
10
12
|
@model_name_solr_field = model_name_solr_field
|
11
13
|
@solr_id_value_attribute = solr_id_value_attribute || 'id'
|
14
|
+
@batching_mode_batch_size = batching_mode_batch_size
|
12
15
|
end
|
13
16
|
|
14
17
|
# Use configured solr_url, and merge together with configured
|
data/lib/kithe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kithe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -264,6 +264,20 @@ dependencies:
|
|
264
264
|
- - ">="
|
265
265
|
- !ruby/object:Gem::Version
|
266
266
|
version: '0'
|
267
|
+
- !ruby/object:Gem::Dependency
|
268
|
+
name: db-query-matchers
|
269
|
+
requirement: !ruby/object:Gem::Requirement
|
270
|
+
requirements:
|
271
|
+
- - "<"
|
272
|
+
- !ruby/object:Gem::Version
|
273
|
+
version: '1'
|
274
|
+
type: :development
|
275
|
+
prerelease: false
|
276
|
+
version_requirements: !ruby/object:Gem::Requirement
|
277
|
+
requirements:
|
278
|
+
- - "<"
|
279
|
+
- !ruby/object:Gem::Version
|
280
|
+
version: '1'
|
267
281
|
- !ruby/object:Gem::Dependency
|
268
282
|
name: pg
|
269
283
|
requirement: !ruby/object:Gem::Requirement
|