activerecord_reindex 0.1.1 → 0.1.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 +4 -4
- data/lib/activerecord_reindex/async_adapter.rb +6 -6
- data/lib/activerecord_reindex/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6508847b036e9191ba24d150c3ca6fd3aff0d147
|
4
|
+
data.tar.gz: 1a73c90b46cb0b0f76ddad37e2451737b1f53112
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 583b1b18878781670b7180cdb15453e7e0306b46dbc30f3f3655e638f2e7108e367818ed6b3b8d6b0f6c4f17db28214a1512607b6d8e39101cf89d894d27ebe2
|
7
|
+
data.tar.gz: 6d5367d14ca8223e851c8d6a98b26102db0cf48db5562c8351c4f5c2a673679d08fcebec36e307db52a2e7cdf56be78ac615d7045b519e945846ce6e92dd40f8
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
# author: Vadim Shaveiko <@vshaveyko>
|
3
3
|
|
4
|
-
# Asyncronouse reindex adapter
|
5
|
-
# uses Jobs for reindexing records asyncronously
|
6
|
-
# Using ActiveJob as dependency bcs activerecord is required for this so
|
7
|
-
# in most cases it would be used with rails hence with ActiveJob
|
8
|
-
# later can think about adding support for differnt job adapters
|
9
4
|
require_relative 'adapter'
|
10
5
|
module ActiverecordReindex
|
6
|
+
# Asyncronouse reindex adapter
|
7
|
+
# uses Jobs for reindexing records asyncronously
|
8
|
+
# Using ActiveJob as dependency bcs activerecord is required for this so
|
9
|
+
# in most cases it would be used with rails hence with ActiveJob
|
10
|
+
# later can think about adding support for differnt job adapters
|
11
11
|
class AsyncAdapter < Adapter
|
12
12
|
|
13
13
|
# Job wrapper. Queues elastic_index queue for each reindex
|
@@ -34,7 +34,7 @@ module ActiverecordReindex
|
|
34
34
|
# we will skip it in associations reindex to prevent recursive reindex and StackLevelTooDeep error
|
35
35
|
def call(record, request_record)
|
36
36
|
return unless _check_elasticsearch_connection(record.class)
|
37
|
-
UpdateJob.perform_later(record.class, record.id, request_record.class, request_record.id)
|
37
|
+
UpdateJob.perform_later(record.class.to_s, record.id, request_record.class.to_s, request_record.id)
|
38
38
|
end
|
39
39
|
|
40
40
|
end
|