Commit d13662ace10b32a749fcae00c370aae4f90d15ad
1 parent
5fc2a512
Exists in
master
and in
21 other branches
Added search data
Showing
4 changed files
with
15 additions
and
2 deletions
Show diff stats
lib/searchkick/model.rb
lib/searchkick/search.rb
test/searchkick_test.rb
... | ... | @@ -14,6 +14,12 @@ class Product < ActiveRecord::Base |
14 | 14 | number_of_shards: 1 |
15 | 15 | }, |
16 | 16 | conversions: true |
17 | + | |
18 | + serialize :conversions, JSON | |
19 | + | |
20 | + def search_data | |
21 | + as_json(except: [:updated_at]) | |
22 | + end | |
17 | 23 | end |
18 | 24 | |
19 | 25 | class TestSearchkick < Minitest::Unit::TestCase |
... | ... | @@ -259,7 +265,7 @@ class TestSearchkick < Minitest::Unit::TestCase |
259 | 265 | |
260 | 266 | def store(documents) |
261 | 267 | documents.each do |document| |
262 | - Product.index.store ({_type: "product"}).merge(document) | |
268 | + Product.create!(document) | |
263 | 269 | end |
264 | 270 | Product.index.refresh |
265 | 271 | end | ... | ... |
test/test_helper.rb