sunspot_mongoid 0.1.2 → 0.2.0
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.
- data/README.md +1 -1
- data/VERSION +1 -1
- data/examples/example.rb +1 -1
- data/lib/sunspot/mongoid.rb +1 -1
- data/test/test_sunspot_mongoid.rb +4 -4
- metadata +2 -2
data/README.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
data/examples/example.rb
CHANGED
data/lib/sunspot/mongoid.rb
CHANGED
@@ -15,7 +15,7 @@ module Sunspot
|
|
15
15
|
extend Sunspot::Rails::Searchable::ClassMethods
|
16
16
|
include Sunspot::Rails::Searchable::InstanceMethods
|
17
17
|
|
18
|
-
def self.
|
18
|
+
def self.searchable(options = {}, &block)
|
19
19
|
Sunspot.setup(self, &block)
|
20
20
|
|
21
21
|
class_inheritable_hash :sunspot_options
|
@@ -9,7 +9,7 @@ class TestSunspotMongoid < Test::Unit::TestCase
|
|
9
9
|
field :title
|
10
10
|
|
11
11
|
include Sunspot::Mongoid
|
12
|
-
|
12
|
+
searchable do
|
13
13
|
text :title
|
14
14
|
end
|
15
15
|
end
|
@@ -19,7 +19,7 @@ class TestSunspotMongoid < Test::Unit::TestCase
|
|
19
19
|
field :title
|
20
20
|
|
21
21
|
include Sunspot::Mongoid
|
22
|
-
|
22
|
+
searchable(:auto_index => false, :auto_remove => false) do
|
23
23
|
text :title
|
24
24
|
end
|
25
25
|
end
|
@@ -30,9 +30,9 @@ class TestSunspotMongoid < Test::Unit::TestCase
|
|
30
30
|
assert Bar.sunspot_options == {:auto_index=>false, :auto_remove=>false, :include=>[]}
|
31
31
|
end
|
32
32
|
|
33
|
-
should 'be called Sunspot.setup when call Foo.
|
33
|
+
should 'be called Sunspot.setup when call Foo.searchable' do
|
34
34
|
mock(Sunspot).setup(Foo)
|
35
|
-
Foo.
|
35
|
+
Foo.searchable
|
36
36
|
end
|
37
37
|
|
38
38
|
should 'get as text_fields from Sunspot::Setup' do
|