Closed
Description
Probably, v3.0.3, the header of CSV::Table is not refreshed by the addition of new CSV::Row object or Hash.
require 'csv'
txt =<<TXT
"h1","h2","h3"
1,"test",3
2,"test",6
3,"test",9
TXT
table = CSV::parse(txt, headers: true)
table.each do |row|
row << {"h4" => "additional"}
end
puts table.to_csv
ver 3.0.3
h1,h2,h3
1,test,3,additional
2,test,6,additional
3,test,9,additional
ver 3.0.0
h1, h2, h3, h4
1, test, 3, additional
2, test, 6, additional
3, test, 9, additional
I'm not sure but from discussion in stack-overflow board or my trial, it was started from 3.0.1.
v 3.0.0 is working as expect.
Metadata
Metadata
Assignees
Labels
No labels