diff --git a/lib/caracal/core/models/table_model.rb b/lib/caracal/core/models/table_model.rb index 5949a3c0..a457a458 100644 --- a/lib/caracal/core/models/table_model.rb +++ b/lib/caracal/core/models/table_model.rb @@ -61,7 +61,7 @@ def cells end def cols - rows.reduce([]) do |array, row| + @cols ||= rows.reduce([]) do |array, row| row.each_with_index do |cell, index| array[index] = [] if array[index].nil? array[index] << cell