oops, broke a test, fixed when a field value does not respond to :each

git-svn-id: https://svn.apache.org/repos/asf/incubator/solr/trunk@496821 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2007-01-16 19:01:13 +00:00
parent b9e804e032
commit 4c8747190b
1 changed files with 5 additions and 1 deletions

View File

@ -37,7 +37,11 @@ module Solr
case fields
when Hash
fields.each_pair do |name,value|
value.each {|v| @fields << Solr::Field.new(name => v)}
if value.respond_to?(:each)
value.each {|v| @fields << Solr::Field.new(name => v)}
else
@fields << Solr::Field.new(name => value)
end
end
when Solr::Field
@fields << fields