lib/unipept/formatters.rb in unipept-0.3.5 vs lib/unipept/formatters.rb in unipept-0.4.0
- old
+ new
@@ -61,12 +61,12 @@
def format(data)
CSV.generate do |csv|
data.each do |o|
if o.kind_of? Array
- o.each {|h| csv << h.values }
+ o.each {|h| csv << h.values.map { |v| v == "" ? nil : v }}
else
- csv << o.values
+ csv << o.values.map { |v| v == "" ? nil : v }
end
end
end
end
end