supernova 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.1
1
+ 0.6.2
@@ -66,14 +66,16 @@ class Supernova::SolrCriteria < Supernova::Criteria
66
66
  if with.blank?
67
67
  []
68
68
  else
69
- with.map do |key_or_condition, value|
70
- if key_or_condition.respond_to?(:solr_filter_for)
71
- key_or_condition.key = solr_field_from_field(key_or_condition.key)
72
- key_or_condition.solr_filter_for(value)
73
- else
74
- fq_filter_for_key_and_value(solr_field_from_field(key_or_condition), value)
69
+ with.map do |key_or_condition, values|
70
+ [values].flatten.map do |value|
71
+ if key_or_condition.respond_to?(:solr_filter_for)
72
+ key_or_condition.key = solr_field_from_field(key_or_condition.key)
73
+ key_or_condition.solr_filter_for(value)
74
+ else
75
+ fq_filter_for_key_and_value(solr_field_from_field(key_or_condition), value)
76
+ end
75
77
  end
76
- end
78
+ end.flatten
77
79
  end
78
80
  end
79
81
 
@@ -177,6 +177,10 @@ describe Supernova::SolrCriteria do
177
177
  criteria.attribute_mapping(:artist_name => { :type => :string }).where(:artist_name => "test").to_params[:fq].should == ["artist_name_s:test"]
178
178
  end
179
179
 
180
+ it "accepts arrays as filters in where" do
181
+ criteria.attribute_mapping(:artist_name => { :type => :string }).where(:artist_name => %w(hans maulwurf)).to_params[:fq].should == ["artist_name_s:hans", "artist_name_s:maulwurf"]
182
+ end
183
+
180
184
  it "uses the mapped fields for all criteria queries" do
181
185
  criteria.attribute_mapping(:artist_name => { :type => :string }).where(:artist_name.ne => nil).to_params[:fq].should == ["artist_name_s:[* TO *]"]
182
186
  end
data/supernova.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{supernova}
8
- s.version = "0.6.1"
8
+ s.version = "0.6.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Tobias Schwab"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: supernova
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
4
+ hash: 3
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 6
9
- - 1
10
- version: 0.6.1
9
+ - 2
10
+ version: 0.6.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Tobias Schwab