multi-solr 01.07.03 → 01.07.04
Sign up to get free protection for your applications and to get access to all the features.
@@ -27,8 +27,11 @@ class MultiSolr::SolrFilterRange < MultiSolr::SolrFilterSimple
|
|
27
27
|
# Beispiel: { 'from' => '2011-01-01', 'to' => '2011-06-01' }
|
28
28
|
# returns: Array mit von und bis ['2011-01-01', '2011-06-01']
|
29
29
|
def extract_from_to value
|
30
|
-
return nil if
|
31
|
-
|
30
|
+
return nil if !value.is_a?(Hash) || value.empty?
|
31
|
+
from, to = value["from"], value["to"]
|
32
|
+
from = nil if from==''
|
33
|
+
to = nil if to==''
|
34
|
+
[from, to]
|
32
35
|
end
|
33
36
|
|
34
37
|
end
|
data/lib/multi_solr/version.rb
CHANGED
@@ -30,10 +30,18 @@ describe MultiSolr::SolrFilterRange do
|
|
30
30
|
subject.build_solr_query('from' => 10).should == 'test:[10 TO *]'
|
31
31
|
end
|
32
32
|
|
33
|
+
it do
|
34
|
+
subject.build_solr_query('from' => 10, 'to' => '').should == 'test:[10 TO *]'
|
35
|
+
end
|
36
|
+
|
33
37
|
it do
|
34
38
|
subject.build_solr_query('to' => 20).should == 'test:[* TO 20]'
|
35
39
|
end
|
36
40
|
|
41
|
+
it do
|
42
|
+
subject.build_solr_query('from' => '', 'to' => 20).should == 'test:[* TO 20]'
|
43
|
+
end
|
44
|
+
|
37
45
|
it do
|
38
46
|
subject.build_solr_query('from' => 10, 'to' => 20).should == 'test:[10 TO 20]'
|
39
47
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multi-solr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 01.07.
|
9
|
+
- 4
|
10
|
+
version: 01.07.04
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Bernd Ledig
|