nobrainer.rb
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
NoBrainer.configure do |config|
config.app_name = :searchkick
config.environment = :test
end
class Product
include NoBrainer::Document
include NoBrainer::Document::Timestamps
field :id, type: Object
field :name, type: Text
field :in_stock, type: Boolean
field :backordered, type: Boolean
field :orders_count, type: Integer
field :found_rate
field :price, type: Integer
field :color, type: String
field :latitude
field :longitude
field :description, type: String
field :alt_description, type: String
belongs_to :store, validates: false
end
class Store
include NoBrainer::Document
field :id, type: Object
field :name, type: String
end
class Region
include NoBrainer::Document
field :id, type: Object
field :name, type: String
field :text, type: Text
end
class Speaker
include NoBrainer::Document
field :id, type: Object
field :name, type: String
end
class Animal
include NoBrainer::Document
field :id, type: Object
field :name, type: String
end
class Dog < Animal
end
class Cat < Animal
end
class Sku
include NoBrainer::Document
field :id, type: String
field :name, type: String
end
class Song
include NoBrainer::Document
field :id, type: Object
field :name, type: String
end