From 4c8747190b96f9350693acad03b06092047dff75 Mon Sep 17 00:00:00 2001 From: Erik Hatcher Date: Tue, 16 Jan 2007 19:01:13 +0000 Subject: [PATCH] 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 --- client/ruby/solrb/lib/solr/document.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ruby/solrb/lib/solr/document.rb b/client/ruby/solrb/lib/solr/document.rb index e29450e02ca..2323b4e1c43 100644 --- a/client/ruby/solrb/lib/solr/document.rb +++ b/client/ruby/solrb/lib/solr/document.rb @@ -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