Skip to content

Business intelligence made simple

Match smart variables when casting

Andrew Kane79c3330b8e65
diff --git a/app/controllers/blazer/queries_controller.rb b/app/controllers/blazer/queries_controller.rb
index 61efcdd1..8d1be86d 100644
--- a/app/controllers/blazer/queries_controller.rb
+++ b/app/controllers/blazer/queries_controller.rb
@@ -107,7 +107,7 @@ module Blazer
if query
values = @rows.map { |r| r[key] }.compact.uniq
rows, error, cached_at = @data_source.run_statement(ActiveRecord::Base.send(:sanitize_sql_array, [query.sub("{value}", "(?)"), values]))
- @boom[key] = Hash[rows.map(&:values)]
+ @boom[key] = Hash[rows.map(&:values).map { |k, v| [k.to_s, v] }]
end
end
diff --git a/app/views/blazer/queries/run.html.erb b/app/views/blazer/queries/run.html.erb
index d9ec5242..836c5ff6 100644
--- a/app/views/blazer/queries/run.html.erb
+++ b/app/views/blazer/queries/run.html.erb
@@ -104,7 +104,7 @@
<%= blazer_format_value(k, v) %>
<% end %>
- <% if v2 = (@boom[k] || {})[v] %>
+ <% if v2 = (@boom[k] || {})[v.to_s] %>
<div class="text-muted"><%= v2 %></div>
<% end %>
<% end %>