Skip to content

Business intelligence made simple

Fixed min width

Andrew Kanece3eb34c0386
diff --git a/app/controllers/blazer/queries_controller.rb b/app/controllers/blazer/queries_controller.rb
index 69614945..81ef1978 100644
--- a/app/controllers/blazer/queries_controller.rb
+++ b/app/controllers/blazer/queries_controller.rb
@@ -192,7 +192,7 @@ module Blazer
end
@filename = @query.name.parameterize if @query
- @min_width_types = @columns.each_with_index.select { |c, i| @first_row[i].is_a?(Time) || @first_row[i].is_a?(String) || @data_source.smart_columns[c] }
+ @min_width_types = @columns.each_with_index.select { |c, i| @first_row[i].is_a?(Time) || @first_row[i].is_a?(String) || @data_source.smart_columns[c] }.map(&:last)
@boom = @result.boom
diff --git a/app/views/blazer/queries/run.html.erb b/app/views/blazer/queries/run.html.erb
index 38c7fb5f..e5540bb8 100644
--- a/app/views/blazer/queries/run.html.erb
+++ b/app/views/blazer/queries/run.html.erb
@@ -116,7 +116,7 @@
<% @columns.each_with_index do |key, i| %>
<% type = @column_types[i] %>
<th style="width: <%= header_width %>%;" data-sort="<%= type %>">
- <div style="min-width: <%= @min_width_types.include?(key) ? 180 : 60 %>px;">
+ <div style="min-width: <%= @min_width_types.include?(i) ? 180 : 60 %>px;">
<%= key %>
</div>
</th>