sunspot_matchers 1.2.1.3 → 1.2.1.4
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/Gemfile.lock
CHANGED
@@ -73,6 +73,7 @@ module SunspotMatchers
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def new_search(*types, &block)
|
76
|
+
types.flatten!
|
76
77
|
search = build_search(*types, &block)
|
77
78
|
@searches << [types, search]
|
78
79
|
search
|
@@ -97,7 +98,7 @@ module SunspotMatchers
|
|
97
98
|
if types.length == 1
|
98
99
|
Sunspot::Setup.for(types.first)
|
99
100
|
else
|
100
|
-
CompositeSetup.for(types)
|
101
|
+
Sunspot::CompositeSetup.for(types)
|
101
102
|
end
|
102
103
|
end
|
103
104
|
end
|
@@ -1,8 +1,10 @@
|
|
1
1
|
require 'sunspot'
|
2
2
|
require 'sunspot_matchers'
|
3
|
+
require 'rspec'
|
3
4
|
|
4
5
|
class Post; end
|
5
6
|
class Blog; end
|
7
|
+
class Person; end
|
6
8
|
|
7
9
|
Sunspot.setup(Post) do
|
8
10
|
text :body
|
@@ -28,6 +30,13 @@ describe "Sunspot Matchers" do
|
|
28
30
|
end
|
29
31
|
|
30
32
|
describe "have_search_params" do
|
33
|
+
it "should allow you to specify your search on multiple models" do
|
34
|
+
Sunspot.search([Post, Blog]) do
|
35
|
+
keywords 'great pizza'
|
36
|
+
end
|
37
|
+
Sunspot.session.should have_search_params(:keywords, 'great pizza')
|
38
|
+
end
|
39
|
+
|
31
40
|
it "should allow you to specify your search" do
|
32
41
|
Sunspot.search(Post) do
|
33
42
|
keywords 'great pizza'
|
@@ -688,6 +697,18 @@ describe "Sunspot Matchers" do
|
|
688
697
|
Sunspot.session.should_not be_a_search_for(Blog)
|
689
698
|
end
|
690
699
|
|
700
|
+
describe "when searching for multiple models" do
|
701
|
+
it "should be true for both" do
|
702
|
+
Sunspot.search([Post, Blog]) do
|
703
|
+
keywords 'great pizza'
|
704
|
+
end
|
705
|
+
|
706
|
+
Sunspot.session.should be_a_search_for(Post)
|
707
|
+
Sunspot.session.should be_a_search_for(Blog)
|
708
|
+
Sunspot.session.should_not be_a_search_for(Person)
|
709
|
+
end
|
710
|
+
end
|
711
|
+
|
691
712
|
describe "with multiple searches" do
|
692
713
|
it "should allow you to choose the search" do
|
693
714
|
Sunspot.search(Blog) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sunspot_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 67
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
9
|
- 1
|
10
|
-
-
|
11
|
-
version: 1.2.1.
|
10
|
+
- 4
|
11
|
+
version: 1.2.1.4
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Joseph Palermo
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
19
|
+
date: 2011-04-01 00:00:00 +08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|