Ticket #7500: fixtures_csv_empty_cell_as_null.patch
| File fixtures_csv_empty_cell_as_null.patch, 0.6 kB (added by yssk22, 2 years ago) |
|---|
-
fixtures.rb
old new 322 322 i = 0 323 323 reader.each do |row| 324 324 data = {} 325 row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell. to_s.strip }325 row.each_with_index { |cell, j| data[header[j].to_s.strip] = cell.blank? ? nil : cell.to_s.strip } 326 326 self["#{Inflector::underscore(@class_name)}_#{i+=1}"]= Fixture.new(data, @class_name) 327 327 end 328 328 elsif File.file?(deprecated_yaml_file_path)