Andrew Kane před 8 roky
rodič
revize
ce3eb34c03

+ 1 - 1
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
 

+ 1 - 1
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>