lib/loquor/api_calls/index.rb in loquor-1.7.0 vs lib/loquor/api_calls/index.rb in loquor-1.8.0
- old
+ new
@@ -94,11 +94,15 @@
else
case value
when String, Symbol, Numeric, Date, Time, DateTime
query_string << "#{key}=#{URI.encode(value.to_s)}"
when Array
- value.each do |v|
- query_string << "#{key}[]=#{URI.encode(v.to_s)}"
+ if value.empty?
+ query_string << "#{key}[]="
+ else
+ value.each do |v|
+ query_string << "#{key}[]=#{URI.encode(v.to_s)}"
+ end
end
when Hash
value.each do |k,v|
query_string << "#{key}[#{k}]=#{URI.encode(v.to_s)}"
end