Commit 98f8b77ff9cd4793a409e19747539571f297fe01
1 parent
4e7ba006
Exists in
master
and in
18 other branches
Fixed Unsupported argument type: Symbol for async partial reindex - fixes #1095
Showing
3 changed files
with
16 additions
and
1 deletions
Show diff stats
CHANGELOG.md
lib/searchkick/record_indexer.rb
... | ... | @@ -26,7 +26,11 @@ module Searchkick |
26 | 26 | raise Searchkick::Error, "Active Job not found" |
27 | 27 | end |
28 | 28 | |
29 | - Searchkick::ReindexV2Job.perform_later(record.class.name, record.id.to_s, method_name) | |
29 | + Searchkick::ReindexV2Job.perform_later( | |
30 | + record.class.name, | |
31 | + record.id.to_s, | |
32 | + method_name ? method_name.to_s : nil | |
33 | + ) | |
30 | 34 | else # bulk, true |
31 | 35 | reindex_record(method_name) |
32 | 36 | ... | ... |
test/partial_reindex_test.rb
... | ... | @@ -55,4 +55,11 @@ class PartialReindexTest < Minitest::Test |
55 | 55 | assert_search "bye", ["Bye"], fields: [:name], load: false |
56 | 56 | assert_search "blue", ["Bye"], fields: [:color], load: false |
57 | 57 | end |
58 | + | |
59 | + def test_instance_method_async | |
60 | + skil unless defined?(ActiveJob) | |
61 | + | |
62 | + product = Product.create!(name: "Hi") | |
63 | + product.reindex(:search_data, mode: :async) | |
64 | + end | |
58 | 65 | end | ... | ... |