Skip to content

Commit 9f9134f

Browse files
committed
Fix CSV force_quotes behavior
1 parent 0873ab3 commit 9f9134f

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/csv/writer.rb

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ def prepare_force_quotes_fields(force_quotes)
117117
"#{name_or_index.inspect}: #{force_quotes.inspect}"
118118
raise ArgumentError, message
119119
end
120-
index = @headers.index(name)
120+
index = @headers.index do |header|
121+
header = header.to_s if header.is_a?(Symbol)
122+
header == name
123+
end
121124
next if index.nil?
122125
@force_quotes_fields[index] = true
123126
else

0 commit comments

Comments
 (0)