lib/write_xlsx/worksheet.rb in write_xlsx-0.86.0 vs lib/write_xlsx/worksheet.rb in write_xlsx-0.87.0
- old
+ new
@@ -5968,14 +5968,20 @@
end
#
# Set the table ids for the worksheet tables.
#
- def prepare_tables(table_id)
+ def prepare_tables(table_id, seen)
if tables_count > 0
id = table_id
tables.each do |table|
table.prepare(id)
+
+ if seen[table.name]
+ raise "error: invalid duplicate table name '#{table.name}' found."
+ else
+ seen[table.name] = 1
+ end
# Store the link used for the rels file.
@external_table_links << ['/table', "../tables/table#{id}.xml"]
id += 1
end