Handle nested arrays correclty

pull/6827/head
Hagen Schink 11 years ago
parent b9a024b72c
commit 2d7ec5f534
  1. 2
      lib/report/query_utils.rb

@ -71,7 +71,7 @@ module Report::QueryUtils
def collection(*values) def collection(*values)
return "" if values.empty? return "" if values.empty?
v = (values.is_a? Array) ? values.each_with_object([]) { |x, l| l << x.to_s.split(',') } v = (values.is_a? Array) ? values.flatten.each_with_object([]) { |x, l| l << x.to_s.split(',') }
: values.to_s.split(',') : values.to_s.split(',')
"(#{v.flatten.map { |x| "'#{quote_string(x)}'" }.join(", ")})" "(#{v.flatten.map { |x| "'#{quote_string(x)}'" }.join(", ")})"
end end

Loading…
Cancel
Save