Andrew Kane vor 9 Jahren
Ursprung
Commit
f8394419ba
2 geänderte Dateien mit 4 neuen und 4 gelöschten Zeilen
  1. 3 3
      app/views/blazer/queries/run.html.erb
  2. 1 1
      app/views/blazer/queries/show.html.erb

+ 3 - 3
app/views/blazer/queries/run.html.erb

@@ -6,13 +6,13 @@
   <p class="text-muted"><%= pluralize(@rows.size, "row") %></p>
   <% if @rows.any? %>
     <% values = @rows.first.values %>
-    <% if values.size >= 2 and values.first.is_a?(Time) and values[1..-1].all?{|v| v.is_a?(Numeric) } %>
+    <% if values.size >= 2 && values.first.is_a?(Time) && values[1..-1].all?{|v| v.is_a?(Numeric) } %>
       <% time_k = @columns.keys.first %>
       <%= line_chart @columns.keys[1..-1].map{|k| {name: k, data: @rows.map{|r| [r[time_k], r[k]] }} } %>
-    <% elsif values.size == 3 and values.first.is_a?(Time) and values[1].is_a?(String) and values[2].is_a?(Numeric) %>
+    <% elsif values.size == 3 && values.first.is_a?(Time) && values[1].is_a?(String) && values[2].is_a?(Numeric) %>
       <% keys = @columns.keys %>
       <%= line_chart @rows.group_by { |v| v[keys[1]] }.map { |name, v| {name: name, data: v.map { |v2| [v2[keys[0]], v2[keys[2]]] } } } %>
-    <% elsif values.size == 2 and values.first.is_a?(String) and values.last.is_a?(Numeric) %>
+    <% elsif values.size == 2 && values.first.is_a?(String) && values.last.is_a?(Numeric) %>
       <%= pie_chart @rows.map(&:values), library: {sliceVisibilityThreshold: 1 / 40.0} %>
     <% end %>
 

+ 1 - 1
app/views/blazer/queries/show.html.erb

@@ -13,7 +13,7 @@
         <%= link_to "Edit", edit_query_path(@query), class: "btn btn-default" %>
         <%= link_to "Fork", new_query_path(statement: @query.statement), class: "btn btn-info" %>
 
-        <% if !@error and @success %>
+        <% if !@error && @success %>
           <%= button_to "Download", run_queries_path(statement: @statement, query_id: @query.id, format: "csv"), class: "btn btn-primary" %>
         <% end %>
       </div>