Commit 8b5940a0f83052dfdf4b5df8eb75f1ee5269c24b
1 parent
f1957300
Exists in
master
and in
21 other branches
Fixed dynamic mapping for inheritance - fixes autocomplete for #85
Showing
3 changed files
with
14 additions
and
2 deletions
Show diff stats
lib/searchkick/reindex.rb
test/inheritance_test.rb
... | ... | @@ -30,4 +30,16 @@ class TestInheritance < Minitest::Unit::TestCase |
30 | 30 | assert_equal 2, Animal.search("bear").size |
31 | 31 | end |
32 | 32 | |
33 | + def test_child_autocomplete | |
34 | + store_names ["Max"], Cat | |
35 | + store_names ["Mark"], Dog | |
36 | + assert_equal ["Max"], Cat.search("ma", fields: [:name], autocomplete: true).map(&:name) | |
37 | + end | |
38 | + | |
39 | + def test_parent_autocomplete | |
40 | + store_names ["Max"], Cat | |
41 | + store_names ["Mark"], Dog | |
42 | + assert_equal ["Mark", "Max"], Animal.search("ma", fields: [:name], autocomplete: true).map(&:name).sort | |
43 | + end | |
44 | + | |
33 | 45 | end | ... | ... |